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 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 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
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
55 changes: 40 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,34 +70,59 @@ 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
with:
java-version: 11

- 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"

- name: Set up Java 8 for the build
- name: Set up Java 17 for Android
uses: actions/setup-java@v4
with:
java-version: 8
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: Release
env:
RELEASE_GPG_PRIVATE_KEY: ${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
Expand Down
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.examples.android'
compileSdkVersion = 33
defaultConfig {
applicationId "com.rollbar.example.android"
minSdkVersion 21
Expand Down
2 changes: 1 addition & 1 deletion examples/rollbar-scala/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ applicationDefaultJvmArgs = [
dependencies {
implementation project(":rollbar-java")

implementation "org.scala-lang:scala-library:2.12.4"
implementation "org.scala-lang:scala-library:2.13.14"
}
4 changes: 2 additions & 2 deletions examples/rollbar-spring-boot-webmvc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.springframework.boot' version '2.0.0.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'org.springframework.boot' version '2.7.12'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'java'
}

Expand Down
Loading
Loading