Skip to content

Conversation

@jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Jun 27, 2025

Cherry picks PR #2264 and PR #2317 from 5.2.x into main.

Cherry picks were clean; no manual changes or extra commits.

The reason is we need both these PRs to publish new versions to maven central, as noted in PR #2317.


This change is Reviewable

jkasten2 added 8 commits June 27, 2025 16:02
Commit just contains the upgrades themselves, a follow up commit will
includes changes required to address their build requirements.
* namespace is now always required
* Some gradle.properties values were completely dropped in APG 8
* Publish release access changed to avoid build error, more changes are need to actually publish.
Since Gradle / AGP 8 upgrade the example doesn't work for
Huawei builds, however this uncovered we were not correctly omitting it
for all tasks.

We will fix Huawei in the example project not building in follow up
commit.
The top level gradle project needs a Java / Kotlin module, otherwise
it skipped publishing an .aar file. While there is no code, projects
consuming this SDK look for it.
  * Maybe we can omit the .aar on in the future for this top level
  project but keeping it working the same for now.

Built SDK with Java 17 and tested publishing with a staging build with:
 * Java 11
 * Gradle 7.3.3
 * APG 7.2.2
 * Android 5 & 14 Emulator

WARNING:
 It is still recommended building with Java 17 instead of 21
 when publishing, as those on older version of R8 will get this
 build error:
 * Cannot invoke "String.length()" because "<parameter1>" is null
 * See https://stackoverflow.com/q/77788162
We will need these as variables so they can be shared with future
changes we are going to make to maven-push.gradle.

"apply from:" doesn't have an option to share the classpath.
OSSRH is shutting down soon so we need to migrate to the Central Portal
for publishing.
* There are no changes to those consuming this SDK, only for mainliners
to publish.

Add the "plugin com.vanniktech.maven.publish" plugin to publish to
the Central Portal.

To publish the following command must be used now:
./gradlew publishToMavenCentral --no-configuration-cache \
-PmavenCentralUsername=USER_TOKEN_USERNAME_HERE \
-PmavenCentralPassword=USER_TOKEN_PASSWORD_HERE \
-Psigning.keyId=ID_HERE \
-Psigning.password=PASSWORD_HERE \
-Psigning.secretKeyRingFile=/FULL/PATH/TO/GPG_FILE_HERE

Can switch to publishAndReleaseToMavenCentral once we do a release
manually and test end-to-end.
@jkasten2 jkasten2 merged commit 53e7c61 into main Jun 30, 2025
2 of 3 checks passed
@jkasten2 jkasten2 deleted the main-gradle8-and-central-portal branch June 30, 2025 20:25
Copy link
Contributor

@jinliu9508 jinliu9508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with several different build environments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants