build: publish AAR + sources via maven-publish for JitPack consumption - #11
Merged
Merged
Conversation
Wire both library modules for artifact publication so downstream consumers can
depend on a pinned version instead of a git submodule or an ad-hoc AAR drop.
The same publication block will later target Maven Central or a private
registry without changing consumer coordinates.
- `featbit-client` and `featbit-client-android` gain the `maven-publish`
plugin and a `MavenPublication("release")` bound to the existing AGP
`singleVariant("release") { withSourcesJar() }` block. Generated POMs get
the usual `name`/`description`/`url`/`licenses` (Apache-2.0)/`scm` blocks.
- Coordinates come from `GROUP` and `VERSION_NAME` in `gradle.properties`.
The publication `version` prefers JitPack's `VERSION` env var over the
gradle property so the file names on disk match the tag JitPack asked for
(JitPack looks up `<artifact>-<tag>.aar`, not `<artifact>-0.1.0-SNAPSHOT.aar`).
- New `jitpack.yml` pins the build JDK to 17 (matching CI) and points JitPack
at the two-module `publishToMavenLocal` invocation so it produces both
artifacts + their sources jar + POM in one pass.
- `README.md` `Installation` section now documents the real JitPack coordinate
(`com.github.Fluent-Health.featbit-android-sdk:<module>:<tag>`) instead of
the earlier `co.featbit:*:<version>` placeholder.
Verified locally: bare `./gradlew publishToMavenLocal` publishes
`co.featbit:*:0.1.0-SNAPSHOT`, and `VERSION=v0.1.0 ./gradlew publishToMavenLocal`
publishes `v0.1.0` end-to-end (parent + cross-module transitive POM entries).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
KaustubhNBhangre
approved these changes
Aug 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
maven-publishplugin tofeatbit-clientandfeatbit-client-android, and declare aMavenPublication("release")on top of the existing AGPsingleVariant("release") { withSourcesJar() }blockGROUP+VERSION_NAMEingradle.properties(co.featbit:*:0.1.0-SNAPSHOTlocally)VERSIONenvironment variable over the gradle property at build time so the file names on disk match the tag JitPack is building (JitPack looks up<artifact>-<tag>.aar, not<artifact>-0.1.0-SNAPSHOT.aar)name,description,url,licenses(Apache-2.0), andscmblocks — accepted by JitPack today, and by Maven Central or a private registry if the artifact is ever republishedjitpack.ymlpinningopenjdk17(matching the existing CI workflow) and pointing JitPack at the two-modulepublishToMavenLocalinvocationREADME.md's Installation section to document the real JitPack coordinate (com.github.Fluent-Health.featbit-android-sdk:<module>:<tag>) instead of the earlierco.featbit:featbit-client:<version>placeholderWhy
Consumers cannot pin a version of this SDK today: they either take a source-level
git submoduledependency, drop a locally-built AAR intolibs/, or fall back to the placeholder coordinate. None scale past a single consumer. Publishing via JitPack costs no additional infrastructure — a git tag on this repository is enough — and keeps the door open for Maven Central or a private registry later without changing consumer code.Verified locally
./gradlew :featbit-client:publishToMavenLocal :featbit-client-android:publishToMavenLocalpublishesco.featbit:featbit-client:0.1.0-SNAPSHOTandco.featbit:featbit-client-android:0.1.0-SNAPSHOTwith AAR + sources jar + POM to~/.m2VERSION=v0.1.0 ./gradlew :featbit-client:publishToMavenLocal :featbit-client-android:publishToMavenLocalsimulates a JitPack build for tagv0.1.0: the files come out asfeatbit-client-v0.1.0.aaretc. and every POM entry (parent module, cross-module transitive) declares the same versionfeatbit-client-android's POM correctly declares a compile-scope dependency onfeatbit-clientat the same version — JitPack rewrites the group tocom.github.Fluent-Health.featbit-android-sdkat serve time as part of its multi-module handlingConsumer wire-up once the first tag lands
Out of scope
VERSION_NAMEingradle.propertiesis only the local fallback; a real release is a git tag, which is the JitPack contractTest plan
./gradlew :featbit-client:publishToMavenLocal :featbit-client-android:publishToMavenLocalsucceeds; inspect~/.m2/repository/co/featbit/…/*.pomfor metadataVERSION=v0.1.0 ./gradlew :featbit-client:publishToMavenLocal :featbit-client-android:publishToMavenLocalproduces-v0.1.0artifact names and version entries in every POMv0.1.0on this branch and request the artifact from JitPack in a scratch Android project; confirmassembleDebugresolves both modules including the transitive dependency