Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/eventbus_exception_invoking_subscriber_…
Browse files Browse the repository at this point in the history
…failed
  • Loading branch information
backwardstruck committed Aug 19, 2024
2 parents 772e349 + 09ebdc1 commit d8c8e04
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 23 deletions.
17 changes: 9 additions & 8 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.15.0
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

agents:
queue: "android"

steps:
- label: "Gradle Wrapper Validation"
command: |
validate_gradle_wrapper
plugins: *common_plugins
plugins: [$CI_TOOLKIT]

# Wait for Gradle Wrapper to be validated before running any other jobs
- wait

- label: "Lint & Checkstyle"
key: "lint_and_checkstyle"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
cp gradle.properties-example gradle.properties
./gradlew lintRelease checkstyle
Expand All @@ -24,7 +25,7 @@ steps:

- label: "Test"
key: "test"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
cp gradle.properties-example gradle.properties
./gradlew testRelease
Expand All @@ -33,7 +34,7 @@ steps:
depends_on:
- "lint_and_checkstyle"
- "test"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
cp gradle.properties-example gradle.properties
./gradlew \
Expand Down
18 changes: 18 additions & 0 deletions .buildkite/schedules/dependency-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

agents:
queue: "android"

steps:
- label: "dependency analysis"
command: |
echo "--- 📊 Analyzing"
cp gradle.properties-example gradle.properties
./gradlew buildHealth
plugins: [$CI_TOOLKIT]
artifact_paths:
- "build/reports/dependency-analysis/build-health-report.*"
notify:
- slack: "#android-core-notifs"
if: build.state == "failed"
6 changes: 6 additions & 0 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.

export CI_TOOLKIT="automattic/a8c-ci-toolkit#3.4.2"
7 changes: 2 additions & 5 deletions WordPressUtils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ repositories {

dependencies {
implementation "org.apache.commons:commons-text:$commonsTextVersion"
implementation "com.android.volley:volley:$volleyVersion"
implementation "com.google.android.material:material:$materialVersion"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$androidxSwipeRefreshLayoutVersion"
implementation "androidx.recyclerview:recyclerview:$androidxRecyclerViewVersion"
implementation "org.greenrobot:eventbus:$eventBusVersion"
implementation "org.greenrobot:eventbus-java:$eventBusVersion"

implementation "androidx.core:core-ktx:$androidxCoreVersion"
implementation "androidx.core:core:$androidxCoreVersion"

testImplementation "junit:junit:$junitVersion"
testImplementation "org.assertj:assertj-core:$assertjVersion"
Expand All @@ -28,8 +27,6 @@ dependencies {
lintChecks "org.wordpress:lint:$wordpressLintVersion"

androidTestImplementation "androidx.test:runner:$androidxTestCoreVersion"
androidTestImplementation "androidx.test:rules:$androidxTestCoreVersion"
androidTestImplementation "androidx.test.ext:junit:$jUnitExtVersion"
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,18 @@ public static void e(T tag, Throwable tr) {
* Sends a ERROR log message
* @param tag Used to identify the source of a log message. It usually identifies the class or activity where the
* log call occurs.
* @param volleyErrorMsg
* @param errorMsg
* @param statusCode
*/
public static void e(T tag, String volleyErrorMsg, int statusCode) {
if (TextUtils.isEmpty(volleyErrorMsg)) {
public static void e(T tag, String errorMsg, int statusCode) {
if (TextUtils.isEmpty(errorMsg)) {
return;
}
String logText;
if (statusCode == -1) {
logText = volleyErrorMsg;
logText = errorMsg;
} else {
logText = volleyErrorMsg + ", status " + statusCode;
logText = errorMsg + ", status " + statusCode;
}
Log.e(TAG + "-" + tag.toString(), logText);
addEntry(tag, LogLevel.w, logText);
Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "com.android.library" apply false
id "org.jetbrains.kotlin.android" apply false
id "com.autonomousapps.dependency-analysis"
}

allprojects {
Expand All @@ -22,6 +23,7 @@ allprojects {
}
tasks.withType(KotlinCompile).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
allWarningsAsErrors = true
}
}
Expand All @@ -44,14 +46,10 @@ ext {
commonsTextVersion = '1.10.0'
eventBusVersion = '3.3.1'
materialVersion = '1.2.1'
volleyVersion = '1.2.0'

// test
androidxTestCoreVersion = '1.4.0'
assertjVersion = '3.11.1'
junitVersion = '4.12'
robolectricVersion = '4.9'

// android test
jUnitExtVersion = '1.1.3'
}
3 changes: 3 additions & 0 deletions gradle.properties-example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ android.useAndroidX=true
android.enableJetifier=false

android.nonTransitiveRClass=true

# Dependency Analysis Plugin
dependency.analysis.android.ignored.variants=release
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.6.10'
gradle.ext.kotlinVersion = '1.9.24'
gradle.ext.agpVersion = '8.1.0'
gradle.ext.automatticPublishToS3Version = '0.9.0'
gradle.ext.dependencyAnalysisVersion = '1.33.0'

plugins {
id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
id "com.android.library" version gradle.ext.agpVersion
id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version
id "com.autonomousapps.dependency-analysis" version gradle.ext.dependencyAnalysisVersion
}
repositories {
maven {
Expand Down

0 comments on commit d8c8e04

Please sign in to comment.