Skip to content

Commit

Permalink
Merge pull request #1034 from ably/chore-update-gradle
Browse files Browse the repository at this point in the history
chore: update gradle wrapper
  • Loading branch information
ttypic authored Oct 7, 2024
2 parents aed323d + 7d70cd9 commit bfd9e7a
Show file tree
Hide file tree
Showing 27 changed files with 370 additions and 592 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ charset = utf-8
indent_style = space
indent_size = 2

[*.{java,groovy,gradle}]
[*.{java,groovy,gradle,kts}]
indent_size = 4

[*.md]
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./gradlew checkstyleMain checkstyleTest checkWithCodenarc runUnitTests
- name: Set up the JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- run: ./gradlew checkWithCodenarc checkstyleMain checkstyleTest runUnitTests
6 changes: 6 additions & 0 deletions .github/workflows/emulate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- name: Set up the JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
with:
submodules: 'recursive'

- name: Set up the JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- run: ./gradlew :java:testRestSuite

- uses: actions/upload-artifact@v3
Expand All @@ -30,6 +36,12 @@ jobs:
with:
submodules: 'recursive'

- name: Set up the JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- run: ./gradlew :java:testRealtimeSuite

- uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Set up the JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'

- name: Build docs
run: ./gradlew javadoc
Expand Down
13 changes: 5 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ implementation files('libs/ably-android-1.2.42.aar')
This library uses [semantic versioning](http://semver.org/). For each release, the following needs to be done:

1. Create a branch for the release, named like `release/1.2.4` (where `1.2.4` is what you're releasing, being the new version)
2. Replace all references of the current version number with the new version number (check the [README.md](./README.md) and [common.gradle](./common.gradle)) and commit the changes
a. Increment the `versionCode` in the Android project's `build.gradle` by 1
2. Replace all references of the current version number with the new version number (check the [README.md](./README.md) and [gradle.properties](./gradle.properties)) and commit the changes
3. Run [`github_changelog_generator`](https://github.com/github-changelog-generator/github-changelog-generator) to automate the update of the [CHANGELOG](./CHANGELOG.md). This may require some manual intervention, both in terms of how the command is run and how the change log file is modified. Your mileage may vary:
- The command you will need to run will look something like this: `github_changelog_generator -u ably -p ably-java --since-tag v1.2.3 --output delta.md --token $GITHUB_TOKEN_WITH_REPO_ACCESS`. Generate token [here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token).
- Using the command above, `--output delta.md` writes changes made after `--since-tag` to a new file.
Expand All @@ -212,12 +211,10 @@ This library uses [semantic versioning](http://semver.org/). For each release, t
5. Make a PR against `main`
6. Once the PR is approved, merge it into `main`
7. From the updated `main` branch on your local workstation, assemble and upload:
1. Run `./gradlew java:assembleRelease -PpublishTarget=MavenCentral` to build and upload `ably-java` to Nexus staging repository
2. Run `./gradlew android:assembleRelease -PpublishTarget=MavenCentral` build and upload `ably-android` to Nexus staging repository
3. Find the new staging repository using the [Nexus Repository Manager](https://oss.sonatype.org/#stagingRepositories)
4. Check that it contains `ably-android` and `ably-java` releases
5. "Close" it - this will take a few minutes during which time it will say (after a refresh of your browser) that "Activity: Operation in Progress"
6. Once it has closed you will have "Release" available. You can allow it to "automatically drop" after successful release. A refresh or two later of the browser and the staging repository will have disappeared from the list (i.e. it's been dropped which implies it was released successfully)
1. Run `./gradlew publishToMavenCentral` to build and upload `ably-java` and `ably-android` to Nexus staging repository
2. Find the new staging repository using the [Nexus Repository Manager](https://oss.sonatype.org/#stagingRepositories)
3. Check that it contains `ably-android` and `ably-java` releases
4. "Release" it - this will take a few minutes during which time it will say (after a refresh of your browser) that "Activity: Operation in Progress". You can allow it to "automatically drop" after successful release. A refresh or two later of the browser and the staging repository will have disappeared from the list (i.e. it's been dropped which implies it was released successfully)
7. A [search for Ably packages](https://oss.sonatype.org/#nexus-search;quick~io.ably) should now list the new version for both `ably-android` and `ably-java`
8. Add a tag and push to origin - e.g.: `git tag v1.2.4 && git push origin v1.2.4`
9. Create the release on Github including populating the release notes
Expand Down
105 changes: 0 additions & 105 deletions android/build.gradle

This file was deleted.

66 changes: 66 additions & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.maven.publish)
}

android {
namespace = "io.ably.lib"
defaultConfig {
minSdk = 19
compileSdk = 30
buildConfigField("String", "LIBRARY_NAME", "\"android\"")
buildConfigField("String", "VERSION", "\"${property("VERSION_NAME")}\"")
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["class"] = "io.ably.lib.test.android.AndroidPushTest"
testInstrumentationRunnerArguments["timeout_msec"] = "300000"
consumerProguardFiles("proguard.txt")
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}

buildFeatures {
buildConfig = true
}

lint {
abortOnError = false
}

testOptions.targetSdk = 30

sourceSets {
getByName("main") {
java.srcDirs("src/main/java", "../lib/src/main/java")
}
getByName("androidTest") {
java.srcDirs("src/androidTest/java", "../lib/src/test/java")
assets.srcDirs("../lib/src/test/resources")
}
}
}

dependencies {
api(libs.gson)
implementation(libs.bundles.common)
testImplementation(libs.bundles.tests)
implementation(libs.firebase.messaging)
androidTestImplementation(libs.bundles.instrumental.android)
}

configurations {
all {
exclude(group = "org.hamcrest", module = "hamcrest-core")
}
getByName("androidTestImplementation") {
extendsFrom(configurations.getByName("testImplementation"))
}
}
4 changes: 4 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_ARTIFACT_ID=ably-android
POM_NAME=Ably Android client library SDK
POM_DESCRIPTION=An Android Realtime and REST client library SDK for the Ably platform.
POM_PACKAGING=aar
Loading

0 comments on commit bfd9e7a

Please sign in to comment.