-
Notifications
You must be signed in to change notification settings - Fork 571
Bump com.android.application from 8.7.0 to 9.2.1 in /src/proguard-android #11717
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
dependabot
wants to merge
15
commits into
main
Choose a base branch
from
dependabot/gradle/src/proguard-android/com.android.application-9.2.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
10ed23d
Bump com.android.application in /src/proguard-android
dependabot[bot] 17fb72c
Bump Gradle wrapper to 9.4.1
jonathanpeppers a44f188
Remove jcenter() from manifestmerger build.gradle
jonathanpeppers 5cb8e46
Merge remote-tracking branch 'origin/main' into dependabot/gradle/src…
jonathanpeppers a2d422f
Document NUGET_CREDENTIALPROVIDER_VSTS_TOKENTYPE=SelfDescribing for m…
jonathanpeppers aceb5c6
Bump AGP to 9.2.1 in LibraryProjectZip test fixture
jonathanpeppers 6ef9fbc
Use shared eng/gradle/*-repositories.gradle in JavaLib fixture
jonathanpeppers ac8f158
Have Dependabot track the JavaLib gradle test fixture
jonathanpeppers eb24c84
Document az-bearer-token fallback for credprovider 401s
jonathanpeppers 1bd45d8
Restructure mirror-on-401 docs around az bearer token loop
jonathanpeppers a3ec68f
Add eng/gradle/mirror-dependencies.ps1 helper
jonathanpeppers 88e2f3c
Remove credprovider fallback from gradle instructions
jonathanpeppers 7f0f450
Update classes.jar path for AGP 9
jonathanpeppers 6f8afe7
Extract classes.jar to a stable path instead of using AGP intermediates
jonathanpeppers 4c1ade1
Address PR review feedback on mirror script and docs
jonathanpeppers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-8.12-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| #!/usr/bin/env pwsh | ||
| <# | ||
| .SYNOPSIS | ||
| Mirrors a gradle project's dependencies into the dnceng dotnet-public-maven | ||
| Azure Artifacts feed so CI can resolve them anonymously. | ||
|
|
||
| .DESCRIPTION | ||
| When Dependabot bumps a gradle dependency (or its transitive graph changes), | ||
| CI fails with 401 errors because the new package(s) haven't been pulled | ||
| from upstream into the dnceng feed yet. CI agents only do anonymous reads, | ||
| so a developer has to authenticate locally once to seed the feed. | ||
|
|
||
| This script does that by running the requested gradle build in a loop: | ||
| 1. Run gradle with RunningOnCI=true so it points at the dnceng feed. | ||
| 2. Parse any 'Could not GET' URLs out of the build log. | ||
| 3. Re-fetch each failing URL with an Azure DevOps OAuth bearer token | ||
| (obtained via `az account get-access-token`). The feed's upstream | ||
| connector then pulls the package and caches it for anonymous reads. | ||
| 4. Repeat until the build succeeds or no more 401s appear. | ||
|
|
||
| After the loop converges, no PR edits are needed — just re-run the failing | ||
| CI job, since the packages are now anonymous-readable. | ||
|
|
||
| .PARAMETER ProjectDir | ||
| Path to the gradle project (the one containing the failing dependency). | ||
| Mirroring must run in the project that actually requires the package; | ||
| a sibling project's build won't trigger a mirror for someone else's deps. | ||
|
|
||
| .PARAMETER Task | ||
| Gradle task(s) to run. Should be one that resolves the new dependency | ||
| graph (e.g. 'assembleDebug', 'build', 'extractProguardFiles'). | ||
|
|
||
| .PARAMETER AndroidHome | ||
| Optional path to the Android SDK. Required when the gradle build needs it | ||
| (any project using the com.android.* plugins). Defaults to the value of | ||
| `$env:ANDROID_HOME` if set. | ||
|
|
||
| .PARAMETER MaxIterations | ||
| Cap on build/mirror cycles. Default 15. Typical convergence is 2-5 | ||
| iterations as the resolver walks the dep graph breadth-first. | ||
|
|
||
| .EXAMPLE | ||
| pwsh ./eng/gradle/mirror-dependencies.ps1 ` | ||
| -ProjectDir tests/CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/java/JavaLib ` | ||
| -Task assembleDebug ` | ||
| -AndroidHome D:\android-toolchain\sdk | ||
|
|
||
| .EXAMPLE | ||
| pwsh ./eng/gradle/mirror-dependencies.ps1 -ProjectDir src/proguard-android -Task extractProguardFiles | ||
| #> | ||
| [CmdletBinding()] | ||
| param( | ||
| [Parameter(Mandatory=$true)] | ||
| [string] $ProjectDir, | ||
|
|
||
| [Parameter(Mandatory=$true)] | ||
| [string] $Task, | ||
|
|
||
| [string] $AndroidHome = $env:ANDROID_HOME, | ||
|
|
||
| [int] $MaxIterations = 15 | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
| $repoRoot = Resolve-Path (Join-Path $PSScriptRoot '../..') | Select-Object -ExpandProperty Path | ||
| $projectDirAbs = Resolve-Path (Join-Path $repoRoot $ProjectDir) -ErrorAction Stop | Select-Object -ExpandProperty Path | ||
| $gradlew = if ($IsWindows -or $env:OS -eq 'Windows_NT') { | ||
| Join-Path $repoRoot 'build-tools/gradle/gradlew.bat' | ||
| } else { | ||
| Join-Path $repoRoot 'build-tools/gradle/gradlew' | ||
| } | ||
| if (-not (Test-Path $gradlew)) { throw "gradlew not found at $gradlew" } | ||
|
|
||
| # Azure DevOps resource id — same for every AzDO tenant. | ||
| $azDevOpsResource = '499b84ac-1321-427f-aa17-267ca6975798' | ||
|
|
||
| function Get-AzDevOpsToken { | ||
| $token = az account get-access-token --resource $azDevOpsResource --query accessToken -o tsv 2>$null | ||
| if ([string]::IsNullOrEmpty($token)) { | ||
| throw "Could not get an Azure DevOps access token. Run 'az login' first." | ||
| } | ||
| return $token | ||
| } | ||
|
|
||
| function Invoke-Mirror($logPath) { | ||
| $urls = Select-String -Path $logPath -Pattern "Could not GET 'https://pkgs\.dev\.azure\.com/dnceng/[^']+'" -AllMatches | | ||
| ForEach-Object { $_.Matches } | | ||
| ForEach-Object { $_.Value -replace "^Could not GET '", "" -replace "'$", "" } | | ||
| Sort-Object -Unique | ||
| if ($urls.Count -eq 0) { return 0 } | ||
| $token = Get-AzDevOpsToken | ||
| $headers = @{ Authorization = "Bearer $token" } | ||
| $ok = 0; $fail = 0 | ||
| foreach ($u in $urls) { | ||
| try { | ||
| $r = Invoke-WebRequest -Uri $u -Headers $headers -SkipHttpErrorCheck -ErrorAction Stop | ||
| if ($r.StatusCode -eq 200) { $ok++ } else { $fail++; Write-Host " $($r.StatusCode) $u" -ForegroundColor Yellow } | ||
| } catch { | ||
| $fail++ | ||
| Write-Host " ERR $u : $_" -ForegroundColor Yellow | ||
| } | ||
| } | ||
| Write-Host " -> mirrored OK=$ok, not-found=$fail (of $($urls.Count))" -ForegroundColor Cyan | ||
| return $urls.Count | ||
| } | ||
|
|
||
| Write-Host "Repo root: $repoRoot" | ||
| Write-Host "Project: $projectDirAbs" | ||
| Write-Host "Task: $Task" | ||
| if ($AndroidHome) { Write-Host "ANDROID_HOME: $AndroidHome" } | ||
|
|
||
| # Verify az is available and authenticated up front so we fail fast. | ||
| Get-AzDevOpsToken | Out-Null | ||
|
|
||
| if ($AndroidHome) { $env:ANDROID_HOME = $AndroidHome } | ||
| $env:RunningOnCI = 'true' | ||
|
|
||
| Push-Location $projectDirAbs | ||
| try { | ||
| for ($i = 1; $i -le $MaxIterations; $i++) { | ||
| Write-Host "`n=== iteration $i ===" -ForegroundColor Green | ||
| $log = Join-Path ([IO.Path]::GetTempPath()) "gradle-mirror-iter-$i.log" | ||
| & $gradlew $Task --no-daemon --refresh-dependencies *>&1 | Tee-Object -FilePath $log | Out-Null | ||
| if (Select-String -Path $log -Pattern 'BUILD SUCCESSFUL' -SimpleMatch -Quiet) { | ||
| Write-Host "`nBUILD SUCCESSFUL after $i iteration(s). The feed now has the packages CI needs." -ForegroundColor Green | ||
| return | ||
| } | ||
| $count = Invoke-Mirror $log | ||
| if ($count -eq 0) { | ||
| Write-Host "`nGradle failed but no 401s to mirror — see $log" -ForegroundColor Red | ||
| Get-Content $log -Tail 30 | ||
| exit 1 | ||
| } | ||
| } | ||
| Write-Host "`nExhausted $MaxIterations iterations without success. Last log:" -ForegroundColor Red | ||
| Get-Content $log -Tail 30 | ||
| exit 1 | ||
| } | ||
| finally { | ||
| Pop-Location | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| plugins { | ||
| id 'com.android.application' version '8.7.0' | ||
| id 'com.android.application' version '9.2.1' | ||
| } | ||
|
|
||
| android { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 3 additions & 19 deletions
22
tests/CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/java/JavaLib/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,10 @@ | ||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
|
||
| buildscript { | ||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| } | ||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:7.4.2' | ||
|
|
||
| // NOTE: Do not place your application dependencies here; they belong | ||
| // in the individual module build.gradle files | ||
| } | ||
| } | ||
|
|
||
| allprojects { | ||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| } | ||
| plugins { | ||
| id 'com.android.library' version '9.2.1' apply false | ||
| } | ||
|
|
||
| task clean(type: Delete) { | ||
| delete rootProject.buildDir | ||
| delete rootProject.layout.buildDirectory | ||
| } | ||
|
|
31 changes: 23 additions & 8 deletions
31
...en-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/java/JavaLib/library/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,40 @@ | ||
| apply plugin: 'com.android.library' | ||
| plugins { | ||
| id 'com.android.library' | ||
| } | ||
|
|
||
| android { | ||
| compileSdkVersion 25 | ||
| namespace 'com.example.javalib' | ||
| compileSdk 35 | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion 19 | ||
| targetSdkVersion 25 | ||
| minSdk 21 | ||
| targetSdk 35 | ||
| versionCode 1 | ||
| versionName "1.0" | ||
|
|
||
| testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
|
||
| } | ||
| buildTypes { | ||
| release { | ||
| minifyEnabled false | ||
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
| proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
| } | ||
|
|
||
| // Extract classes.jar from the AAR to a stable path that the binding | ||
| // project (../../../Xamarin.Android.LibraryProjectZip-LibBinding.csproj) | ||
| // can reference without depending on AGP intermediates/ layout, which | ||
| // Google reorganizes between major AGP versions. | ||
| tasks.register('extractClassesJar', Copy) { | ||
| dependsOn 'assembleDebug' | ||
| def aar = layout.buildDirectory.file('outputs/aar/library-debug.aar') | ||
| from({ zipTree(aar) }) { | ||
| include 'classes.jar' | ||
| } | ||
| into layout.buildDirectory.dir('libs') | ||
| } | ||
|
|
||
| tasks.matching { it.name == 'assembleDebug' }.configureEach { finalizedBy 'extractClassesJar' } |
2 changes: 1 addition & 1 deletion
2
...in.Android.LibraryProjectZip-LibBinding/java/JavaLib/library/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.javalib"> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| </manifest> |
14 changes: 14 additions & 0 deletions
14
...CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/java/JavaLib/settings.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,15 @@ | ||
| // See: eng/gradle/plugin-repositories.gradle, eng/gradle/dependency-repositories.gradle | ||
| pluginManagement { | ||
| apply from: "${rootDir}/../../../../../eng/gradle/plugin-repositories.gradle", to: pluginManagement | ||
| } | ||
|
|
||
| plugins { | ||
| id 'com.microsoft.azure.artifacts.credprovider' version '1.1.1' | ||
| } | ||
|
|
||
| dependencyResolutionManagement { | ||
| apply from: "${rootDir}/../../../../../eng/gradle/dependency-repositories.gradle", to: dependencyResolutionManagement | ||
| } | ||
|
|
||
| rootProject.name = 'JavaLib' | ||
| include ':library' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.