Skip to content

[Feat][SDK- 471] Update publishing #342

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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2ab0401
build: update gradle from 6.9.4 to 8.14.3
christianbuon Jul 22, 2025
9adca7c
build: update quality gradle files
christianbuon Jul 22, 2025
f285843
build: update agp from 4.2.2 to 7.4.2
christianbuon Jul 22, 2025
383623a
build: update scala from 2.12.4 to 2.13.14
christianbuon Jul 22, 2025
05719e4
build: update spring boot and spring dependency management
christianbuon Jul 22, 2025
1017308
build: update revapi from 1.4.4 to 1.8.0
christianbuon Jul 22, 2025
4fcc612
build: update nebula integration testing plugin from 3.4.0 to 10.0.1
christianbuon Jul 22, 2025
ac0cf7b
build: bumpt agp from 7.4.2 to 8.6.0
christianbuon Jul 26, 2025
a011bad
build: add vanniktech plugin (skip Android for the moment because agp…
christianbuon Jul 26, 2025
8ab37d8
build: update build.gradle groovy to kotlin
christianbuon Aug 4, 2025
bcc5eb0
build: add version catalog and update settings.gradle to kotlin
christianbuon Aug 4, 2025
622c136
build: replace release.gradle with publish convention plugin
christianbuon Aug 4, 2025
8588ba9
build: update android build.gradle to kotlin
christianbuon Aug 4, 2025
450a81a
build: update ci
christianbuon Aug 4, 2025
c4d7192
build: skip Android quality check for now
christianbuon Aug 4, 2025
eacfdb9
build: register agp in root build.gradle.kts to prevent agp not found…
christianbuon Aug 11, 2025
3fbba5a
build(rollbar-java): migrate build.gradle to Kotlin and fix failing CI
christianbuon Aug 14, 2025
c0da9ca
build(rollbar-java): update canonical path for generated code
christianbuon Aug 14, 2025
210ef84
build(rollbar-java): declare inputs so Gradle knows when to rerun the…
christianbuon Aug 14, 2025
91a3164
build: update mokito to 5.18.0 and fix Java tests
christianbuon Aug 14, 2025
af3b327
test: fix failing test in Java 17
christianbuon Aug 18, 2025
1223b17
build: use kotlin for rollbar-reactive-streams gradle, update testng …
christianbuon Aug 18, 2025
d517e1f
test: fix failing tests from mockito update
christianbuon Aug 18, 2025
44bb8aa
build: add JVM flag for BlockHound test tasks on JDK 13+
christianbuon Aug 19, 2025
c93f711
build: add flag only in Java 17
christianbuon Aug 19, 2025
139fe16
test: fix failing test
christianbuon Aug 19, 2025
f41060c
build(android): remove package from manifests, is deprecated in AGP 8+
christianbuon Aug 19, 2025
c12acf8
build(android-example): fix namespace misspelling
christianbuon Aug 19, 2025
1f3749f
build: add Gradle JVM option to increase MetaspaceSize and heap in CI…
christianbuon Aug 19, 2025
82db09a
build: use Vanniktech plugin for release
christianbuon Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ elif [[ -z $VERSION ]]; then
elif ! [[ $VERSION =~ $SEMVER_REGEX ]]; then
echo "Skipping release. Bad version used."
else

if [[ ${BASH_REMATCH[5]} == 'SNAPSHOT' ]]; then
echo "Doing SNAPSHOT release..."
./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype
else
echo "Doing release..."
./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype closeAndReleaseRepository
fi
echo "Doing release with Vanniktech Maven Publish plugin..."
./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 \
-Dorg.gradle.internal.http.connectionTimeout=300000 \
publish
echo "Release done!"
fi
72 changes: 51 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
required: true
RELEASE_GPG_PRIVATE_KEY_PASSPHRASE:
required: true
NEXUS_USERNAME:
MAVENCENTRAL_USERNAME:
required: true
NEXUS_PASSWORD:
MAVENCENTRAL_PASSWORD:
required: true
push:
branches: [ master ]
Expand All @@ -33,7 +33,7 @@ jobs:
matrix:
# Must upgrade Gradle before we can go past Java 15 here.
# https://docs.gradle.org/current/userguide/compatibility.html
java: [ 8, 11 ]
java: [ 11, 17 ]
steps:
- uses: actions/checkout@v4

Expand All @@ -60,7 +60,7 @@ jobs:
echo ANDROID_SDK_ROOT: ${ANDROID_SDK_ROOT}

- name: Build
run: ./gradlew clean build
run: ./gradlew clean build --no-daemon

- name: Upload build reports
if: always()
Expand All @@ -70,39 +70,69 @@ jobs:
path: |
**/build/reports/*

build-android:
runs-on: ubuntu-22.04
name: Build Android module with Java 17
needs: [ validation ]
steps:
- uses: actions/checkout@v4
- name: Fetch git tags
run: ./.github/scripts/fetch_to_tag.sh

- name: Set up Java 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
cache: 'gradle'

- name: Install Android SDK
run: |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "build-tools;34.0.0"

- name: Build Android module
run: ./gradlew :rollbar-android:build

- name: Upload Android build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: android-java17-build-reports
path: |
**/build/reports/*

release:
runs-on: ubuntu-22.04
name: Release
# It would be nice to run this as part of the build job, since it would be
# faster and have less duplicated Yaml, it would not be possible to check
# for all matrix results before publishing if this were just another step
# in that job.
needs: [ build ]
needs: [ build, build-android ]
steps:
- uses: actions/checkout@v4

- name: Set up Java 11 for the Android SDK Manager
uses: actions/setup-java@v1
- name: Set up Java 17 for Android
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'zulu'
cache: 'gradle'

- name: Install Android SDK
run: |
echo "Android SDK Manager version: `${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --version`"
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-27" "build-tools;28.0.3"
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "build-tools;34.0.0"

- name: Set up Java 8 for the build
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
cache: 'gradle'
- name: Configure Gradle properties
run: |
mkdir -p ~/.gradle
cat <<EOF >> ~/.gradle/gradle.properties
mavenCentralUsername=${{ secrets.MAVENCENTRAL_USERNAME }}
mavenCentralPassword=${{ secrets.MAVENCENTRAL_PASSWORD }}
signing.password=${{ secrets.RELEASE_GPG_PRIVATE_KEY_PASSPHRASE }}
signing.key=${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
EOF

- name: Release
env:
RELEASE_GPG_PRIVATE_KEY: ${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
RELEASE_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.RELEASE_GPG_PRIVATE_KEY_PASSPHRASE }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
./.github/scripts/release.sh
23 changes: 23 additions & 0 deletions build-logic/conventions/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
`kotlin-dsl`
}

group = "com.rollbar.buildlogic"

repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("com.vanniktech:gradle-maven-publish-plugin:0.34.0")
}

gradlePlugin {
plugins {
create("rollbar-release-plugin") {
id = "com.rollbar.conventions.release"
implementationClass = "RollbarPublishPlugin"
}
}
}
61 changes: 61 additions & 0 deletions build-logic/conventions/src/main/kotlin/RollbarPublishPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.gradle.api.Plugin
import org.gradle.api.Project

class RollbarPublishPlugin : Plugin<Project> {
override fun apply(project: Project) {

project.pluginManager.withPlugin("com.android.library") {
applyPlugin(project)
}

project.plugins.withId("java-library") {
applyPlugin(project)
}

}

private fun applyPlugin(project: Project) {
project.plugins.apply("com.vanniktech.maven.publish")

project.extensions.configure(MavenPublishBaseExtension::class.java) {
pom {
name.set(project.findProperty("POM_NAME") as String)
description.set(project.findProperty("POM_DESCRIPTION") as String)
url.set(project.findProperty("POM_URL") as String)

licenses {
license {
name.set(project.findProperty("POM_LICENCE_NAME") as String)
url.set(project.findProperty("POM_LICENCE_URL") as String)
distribution.set(project.findProperty("POM_LICENCE_DIST") as String)
}
}

developers {
developer {
id.set("rokob")
name.set("Andrew Weiss")
}
developer {
id.set("basoko")
name.set("David Basoco")
}
developer {
id.set("diegov")
name.set("Diego Veralli")
}
}

scm {
url.set(project.findProperty("POM_SCM_URL") as String)
connection.set(project.findProperty("POM_SCM_CONNECTION") as String)
developerConnection.set(project.findProperty("POM_SCM_DEV_CONNECTION") as String)
}
}

publishToMavenCentral()
signAllPublications()
}
}
}
10 changes: 10 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}

rootProject.name = "build-logic"

include(":conventions")
84 changes: 0 additions & 84 deletions build.gradle

This file was deleted.

62 changes: 62 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
alias(rollbarlibs.plugins.androidLibrary) apply false
alias(rollbarlibs.plugins.vanniktech) apply false
alias(rollbarlibs.plugins.spotbugs) apply false
alias(rollbarlibs.plugins.revapi) apply false
id("com.rollbar.conventions.release") apply false
}

val versionName = rootProject.extra["VERSION_NAME"] as String

allprojects {
version = versionName

repositories {
google()
mavenCentral()
}
}

subprojects {
val isExample = name.contains("examples") || parent?.name == "examples"
val isAndroid = name.contains("android")

if (isExample || isAndroid) {
return@subprojects
}

apply(plugin = "java-library")
apply(plugin = "com.rollbar.conventions.release")
apply(from = "$rootDir/gradle/quality.gradle")
apply(from = "$rootDir/gradle/compatibility.gradle")

repositories {
mavenCentral()
}

tasks.withType<Jar>().configureEach {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to versionName
)
)
}
}

dependencies {
add("testImplementation", "junit:junit:4.13.2")
add("testImplementation", "org.hamcrest:hamcrest-all:1.3")
add("testImplementation", "org.mockito:mockito-core:5.18.0")
}

tasks.withType<JavaCompile>().configureEach {
if (JavaVersion.current().isJava9Compatible) {
options.release.set(8)
} else {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
}
}
6 changes: 3 additions & 3 deletions examples/rollbar-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:8.6.0'
}
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 33
buildToolsVersion "30.0.3"
namespace 'com.rollbar.example.android'
compileSdkVersion = 33
defaultConfig {
applicationId "com.rollbar.example.android"
minSdkVersion 21
Expand Down
Loading