Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into provenance
Browse files Browse the repository at this point in the history
* upstream/main:
  Upgrade gradle version (#300)
  Resolving main to release-branch conflicts before creating PR from main (#299)
  Preparing for the next release (#294)
  Remove compilesdk validation (#292)
  • Loading branch information
v1v committed Apr 23, 2024
2 parents bb15b91 + 7ef9a1d commit d616508
Show file tree
Hide file tree
Showing 24 changed files with 72 additions and 53 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/updateVersionBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ jobs:
text: ${{ github.event.pull_request.head.ref }}
regex: 'post-release/(\d+).+'

- run: gh pr create --base ${{ env.BASE_BRANCH }} --title 'Merge main into version branch' --body 'Created by Github action' --reviewer elastic/apm-agent-android
- run: |
CONFLICT_RESOLUTION_BRANCH="post-release/main-to-${{ env.BASE_BRANCH }}"
git switch ${{ env.BASE_BRANCH }}
git checkout -b $CONFLICT_RESOLUTION_BRANCH
git merge main --strategy-option theirs
git push -u origin $CONFLICT_RESOLUTION_BRANCH
gh pr create --base ${{ env.BASE_BRANCH }} --title 'Merge main into version branch' --body 'Created by Github action :robot:' --reviewer elastic/apm-agent-android
env:
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
BASE_BRANCH: "${{ steps.major-version.outputs.group1 }}.x"
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
17
8 changes: 8 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ ${next_release_notes}
* New feature: {pull}000[#000]
////
[[release-notes-0.16.0]]
==== 0.16.0 - 2024/04/03
[float]
===== Bug fixes
* Removing strict version constraint that prevented enforcing compileSdk > 33: {pull}292[#292]
[[release-notes-0.15.0]]
==== 0.15.0 - 2024/03/11
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Copyright 2018-2022 Elasticsearch B.V.

This product includes software licensed under the 'Apache License Version 2.0' license from the following sources:

- Android Lifecycle Process (https://developer.android.com/jetpack/androidx/releases/lifecycle#2.6.1)
- Android Lifecycle Process (https://developer.android.com/jetpack/androidx/releases/lifecycle#2.6.2)
- Android Support Library Annotations (https://developer.android.com/jetpack/androidx/releases/annotation#1.4.0)
- Byte Buddy (without dependencies)
- Byte Buddy Gradle plugin
Expand Down
14 changes: 0 additions & 14 deletions android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,4 @@ dependencies {
compileOnly 'co.elastic.apm.compile:processor'
testImplementation libs.bundles.mocking
testImplementation libs.junit

// To avoid enforcing compileSdk > 33:
constraints {
add("implementation", "androidx.navigation:navigation-fragment") {
version {
strictly("2.6.0")
}
}
add("implementation", "androidx.core:core") {
version {
strictly("1.10.1")
}
}
}
}
2 changes: 1 addition & 1 deletion android-sdk/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dependencies.hash=F58F6A39BDAD2A7E96BD4C0924CF4A0C
dependencies.hash=77B4570CA3D2C0BA9C3541561D0679C0
2 changes: 1 addition & 1 deletion android-sdk/src/main/resources/META-INF/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Copyright 2018-2022 Elasticsearch B.V.

This product includes software licensed under the 'Apache License Version 2.0' license from the following sources:

- Android Lifecycle Process (https://developer.android.com/jetpack/androidx/releases/lifecycle#2.6.1)
- Android Lifecycle Process (https://developer.android.com/jetpack/androidx/releases/lifecycle#2.6.2)
- com.github.instacart.truetime-android:library:3.5
- okhttp (https://square.github.io/okhttp/)
- OpenTelemetry Android (https://github.com/open-telemetry/opentelemetry-android)
Expand Down
7 changes: 6 additions & 1 deletion android-test/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ android {

testInstrumentationRunner "co.elastic.apm.android.test.base.TestRunner"
}
buildFeatures {
buildConfig = true
}

buildTypes {
release {
Expand All @@ -45,6 +48,7 @@ android {
compileOptions {
sourceCompatibility jvmCompatibility
targetCompatibility jvmCompatibility
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = jvmCompatibility.toString()
Expand All @@ -63,10 +67,11 @@ dependencies {
implementation "androidx.test.espresso:espresso-idling-resource:$espresso_version"
implementation project(':android-test-common')
implementation "androidx.fragment:fragment-testing:1.6.1"
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
testImplementation "io.opentelemetry:opentelemetry-exporter-otlp:1.28.0"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.mockito:mockito-inline:$mockito_version"
testImplementation 'org.robolectric:robolectric:4.11.1'
testImplementation 'org.robolectric:robolectric:4.12.1'
testImplementation "com.squareup.okhttp3:mockwebserver:$mockwebserver_version"
androidTestImplementation "androidx.test:core:1.5.0"
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void whenALogIsCreated_osDescriptionIsSet() {
LogRecordData log = captureLog();

Logs.verifyRecord(log)
.hasResource("os.description", "Android 13, API level 33, BUILD unknown");
.hasResource("os.description", "Android 14, API level 34, BUILD unknown");
}

@Test
Expand All @@ -87,7 +87,7 @@ public void whenALogIsCreated_osVersionSet() {
LogRecordData log = captureLog();

Logs.verifyRecord(log)
.hasResource("os.version", "13");
.hasResource("os.version", "14");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void whenAMetricIsCreated_osDescriptionIsSet() {
MetricData metric = captureMetric();

Metrics.verify(metric)
.hasResource("os.description", "Android 13, API level 33, BUILD unknown");
.hasResource("os.description", "Android 14, API level 34, BUILD unknown");
}

@Test
Expand All @@ -87,7 +87,7 @@ public void whenAMetricIsCreated_osVersionSet() {
MetricData metric = captureMetric();

Metrics.verify(metric)
.hasResource("os.version", "13");
.hasResource("os.version", "14");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void whenASpanIsCreated_osDescriptionIsSet() {
SpanData customSpan = captureSpan();

Spans.verify(customSpan)
.hasResource("os.description", "Android 13, API level 33, BUILD unknown");
.hasResource("os.description", "Android 14, API level 34, BUILD unknown");
}

@Test
Expand All @@ -89,7 +89,7 @@ public void whenASpanIsCreated_osVersionSet() {
SpanData customSpan = captureSpan();

Spans.verify(customSpan)
.hasResource("os.version", "13");
.hasResource("os.version", "14");
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions android-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ propertiesFile.withInputStream {
}

ext {
jvmCompatibility = JavaVersion.VERSION_11
jvmCompatibility = JavaVersion.VERSION_17
junit_version = '4.13.2'
espresso_version = '3.5.1'
mockito_version = '4.9.0'
agp_version = '7.4.0'
agp_version = '8.3.0'
mockwebserver_version = '4.10.0'
androidCompileSdk = 33
androidCompileSdk = 34
androidMinSdk = 26
agent_version = agentProperties["version"]
}
Expand Down
2 changes: 1 addition & 1 deletion android-test/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
2 changes: 1 addition & 1 deletion android-test/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion android-test/plugin-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ dependencies {
implementation "co.elastic.apm:android-plugin:$agent_version"
testImplementation "co.elastic.apm:android-common:$agent_version"
testImplementation "junit:junit:$junit_version"
testImplementation "com.github.stefanbirkner:system-rules:1.19.0"
testImplementation "uk.org.webcompere:system-stubs-junit4:2.1.6"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.EnvironmentVariables;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.util.Properties;

import co.elastic.apm.android.common.ApmInfo;
import uk.org.webcompere.systemstubs.rules.EnvironmentVariablesRule;

public class CompilationConfigTest extends BaseAssetsVerificationTest {

@Rule
public EnvironmentVariables environmentVariables = new EnvironmentVariables();
public EnvironmentVariablesRule environmentVariables = new EnvironmentVariablesRule();

@Rule
public TemporaryFolder projectTemporaryFolder = new TemporaryFolder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void ensureExistingParentDir(File file) {
}

protected int getAndroidCompileSdk() {
return 33;
return 34;
}

protected String getAndroidAppId() {
Expand Down
6 changes: 3 additions & 3 deletions docs/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ You can skip this step if your `minSdkVersion` is 26 or higher.
[[adding-gradle-plugin]]
==== Add the Elastic Agent Gradle plugin

To automatically instrument <<supported-technologies,Supported Technologies>>, add the https://plugins.gradle.org/plugin/co.elastic.apm.android/0.15.0[Elastic APM agent plugin] to your application's `build.gradle` file as shown below:
To automatically instrument <<supported-technologies,Supported Technologies>>, add the https://plugins.gradle.org/plugin/co.elastic.apm.android/0.16.0[Elastic APM agent plugin] to your application's `build.gradle` file as shown below:

[source,groovy]
----
// Android app's build.gradle file
plugins {
id "com.android.application"
id "co.elastic.apm.android" version "0.15.0"
id "co.elastic.apm.android" version "0.16.0"
}
----

Expand Down Expand Up @@ -122,7 +122,7 @@ Add the Elastic APM agent SDK to your application's `build.gradle` file as shown
----
// Android app's build.gradle file
dependencies {
implementation "co.elastic.apm:android-sdk:0.15.0"
implementation "co.elastic.apm:android-sdk:0.16.0"
}
----

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Mon Mar 11 09:51:53 UTC 2024
#Wed Apr 03 14:24:32 UTC 2024
androidGradlePlugin_version=7.4.0
description=APM for Android applications with the Elastic stack
org.gradle.jvmargs=-XX\:MaxMetaspaceSize\=2G
version=0.16.0
version=0.17.0
android.useAndroidX=true
group=co.elastic.apm
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
4 changes: 2 additions & 2 deletions sample-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ plugins {

android {
namespace 'co.elastic.apm.android.sample'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "co.elastic.apm.android.sample"
minSdk 26
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand Down

0 comments on commit d616508

Please sign in to comment.