Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
- [ ] Built wrapper: `bash src/Kapusch.FacebookApisForAndroidComponents/Native/Android/build.sh`
- [ ] Restored pinned AARs: `bash src/Kapusch.FacebookApisForAndroidComponents/Native/Android/restore-facebook-aars.sh`
- [ ] Packed NuGet: `dotnet pack src/Kapusch.FacebookApisForAndroidComponents/Kapusch.FacebookApisForAndroidComponents.csproj -c Release -o artifacts/nuget`
- [ ] Ran the validators listed in `README.md`
- [ ] Updated docs if behavior/integration changed
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
with:
dotnet-version: "10.0.203"

- name: Scan public tree
env:
# Optional; the scan skips private terms when the secret is not set.
KAPUSCH_PRIVATE_TERMS: ${{ secrets.KAPUSCH_PRIVATE_TERMS }}
run: python3 scripts/verify-public.py

- name: Validate feature selection
run: bash tests/validate-feature-selection.sh

Expand Down Expand Up @@ -51,11 +57,29 @@ jobs:
run: |
bash src/Kapusch.FacebookApisForAndroidComponents/Native/Android/restore-facebook-aars.sh

- name: Verify App Events constants and JNI contract
run: |
python3 scripts/app-event-constants.py
python3 scripts/verify-interop.py jni

- name: Pack
run: |
dotnet pack src/Kapusch.FacebookApisForAndroidComponents/Kapusch.FacebookApisForAndroidComponents.csproj \
-c Release \
-o artifacts/nuget

- name: Validate package
run: python3 scripts/validate-package.py artifacts/nuget

- name: Build sample with R8 and verify the shrunk APK
run: |
dotnet build samples/Kapusch.Facebook.Android.Sample/Kapusch.Facebook.Android.Sample.csproj \
-c Release \
-p:SampleRuntimeIdentifiers=android-arm64
python3 scripts/verify-interop.py apk \
samples/Kapusch.Facebook.Android.Sample/bin/Release/net10.0-android/com.kapusch.facebookandroid.sample-Signed.apk \
--feature Login --feature Share

- uses: actions/upload-artifact@v4
with:
name: nuget
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ jobs:
with:
dotnet-version: "10.0.203"

- name: Scan public tree
env:
# Optional; the scan skips private terms when the secret is not set.
KAPUSCH_PRIVATE_TERMS: ${{ secrets.KAPUSCH_PRIVATE_TERMS }}
run: python3 scripts/verify-public.py

- name: Validate feature selection
run: bash tests/validate-feature-selection.sh

Expand Down Expand Up @@ -105,13 +111,21 @@ jobs:
run: |
bash src/Kapusch.FacebookApisForAndroidComponents/Native/Android/restore-facebook-aars.sh

- name: Verify App Events constants and JNI contract
run: |
python3 scripts/app-event-constants.py
python3 scripts/verify-interop.py jni

- name: Pack
run: |
dotnet pack src/Kapusch.FacebookApisForAndroidComponents/Kapusch.FacebookApisForAndroidComponents.csproj \
-c Release \
-o artifacts/nuget \
/p:PackageVersion="${{ steps.version.outputs.version }}"

- name: Validate package
run: python3 scripts/validate-package.py artifacts/nuget

- name: Push to NuGet.org
if: steps.version.outputs.publish_target == 'nuget'
uses: NuGet/login@v1
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/sample-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ jobs:
- name: Build Android sample
run: |
dotnet build samples/Kapusch.Facebook.Android.Sample/Kapusch.Facebook.Android.Sample.csproj -c Debug

- name: Build Android sample with R8
run: |
dotnet build samples/Kapusch.Facebook.Android.Sample/Kapusch.Facebook.Android.Sample.csproj -c Release
python3 scripts/verify-interop.py apk \
samples/Kapusch.Facebook.Android.Sample/bin/Release/net10.0-android/com.kapusch.facebookandroid.sample-Signed.apk \
--feature Login --feature Share
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ samples/**/secrets.*
# Sample generated files
samples/**/AndroidManifest.xml
samples/**/strings.xml

# Python
__pycache__/
9 changes: 8 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# Kapusch.FacebookApisForAndroidComponents — AI Working Agreement

## Goals
- Produce a reproducible Android NuGet package for selectable Facebook Login and Share interop.
- Produce a reproducible Android NuGet package for selectable Facebook Login, Share and App Events interop.
- Do not commit secrets.

## Packaging constraints
- Public OSS repo: keep docs/sample generic and not app-specific.
- The NuGet ships the required `.aar` artifacts and injects them into consuming apps via `buildTransitive` `AndroidAarLibrary`.
- Consuming apps must not download native deps at build time.
- Do not bundle shared dependencies (AndroidX, Kotlin, Play Install Referrer, Google Play services); consumers get them from managed `Xamarin.*` NuGets.
- The default feature selection stays `Login`; new features must not change what existing consumers inject.
- The App Events facade is reached only through JNI: keep `consumer-rules.pro`, `scripts/verify-interop.py` and `FacebookAppEvents.cs` in sync, and regenerate the constants with `scripts/app-event-constants.py --write` after an SDK bump.
- This repo may download dependencies during CI/build, but consuming apps must not.

## Repo layout
- `src/Kapusch.FacebookApisForAndroidComponents/` — NuGet project (managed API + buildTransitive MSBuild)
- `src/Kapusch.FacebookApisForAndroidComponents/Native/Android/` — Gradle wrapper library + scripts (repo-only)
- `scripts/` — deterministic validators (package layout, JNI contract, R8 output, constants, public-tree scan)
- `tests/` — MSBuild feature-selection and warning tests
- `DependencyLocks/` — pinned third-party artifacts (URLs + SHA256)
- `Docs/` — integration docs
- `samples/` — optional sample template (no secrets committed)

## Safety
- Do not add new dependency ingestion paths without documenting them in `README.md`.
- Do not commit real app ids/secrets.
- Keep the tree generic: no application or company names, real Meta app ids, client tokens or emails (`scripts/verify-public.py`).
- When package contents change, update `scripts/validate-package.py` in the same commit.

## Branches and releases
- `master` is the only long-lived branch and the source of every NuGet.org release.
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Pack the NuGet:

- `dotnet pack src/Kapusch.FacebookApisForAndroidComponents/Kapusch.FacebookApisForAndroidComponents.csproj -c Release -o artifacts/nuget`

Run the validators listed in `README.md` before opening a PR; CI runs the same set.

## Formatting

- C#: follow `.editorconfig` (tabs, LF).
Expand All @@ -38,6 +40,10 @@ Pack the NuGet:
- `src/Kapusch.FacebookApisForAndroidComponents/Native/Android/facebookinterop/build.gradle.kts`
- `DependencyLocks/Android/lockstate.txt` (URLs + SHA256)

Then regenerate the App Events constants with
`python3 scripts/app-event-constants.py --write`, review the upstream changelog
for new manifest switches, and rebuild the sample with R8.

See `Docs/Release.md` before changing versions, tags, or publishing workflows.

## License
Expand Down
10 changes: 5 additions & 5 deletions DependencyLocks/Android/lockstate.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Pinned Android artifacts for deterministic restore.
# Format: <url> <sha256> <filename>

https://repo1.maven.org/maven2/com/facebook/android/facebook-login/18.1.3/facebook-login-18.1.3.aar 30a0bb79b74244228c63101c26353ad61a973e156ca55b712b59fe56fc952100 facebook-login-18.1.3.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-core/18.1.3/facebook-core-18.1.3.aar ef480916149e078f955195981130b05746ca33b41618911e7093aa32c03d601b facebook-core-18.1.3.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-common/18.1.3/facebook-common-18.1.3.aar 62adfb1cd05184065d69033a9f917709b392004f87a8aa1cc1c4f0e9fb5ca781 facebook-common-18.1.3.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-bolts/18.1.3/facebook-bolts-18.1.3.aar 05c6bae0130487e63add05854a3bbd21465c06a295a2104b3948d8759536b699 facebook-bolts-18.1.3.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-share/18.1.3/facebook-share-18.1.3.aar cc3bc76fdb987ac245ddc54b37096e2afcfb438872487034027639dd4564aef7 facebook-share-18.1.3.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-login/19.0.0/facebook-login-19.0.0.aar 87f10f0efd2b0c5b1c25a0026bf7f37128aa5a1d9195af34966a76cfb54b7ffa facebook-login-19.0.0.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-core/19.0.0/facebook-core-19.0.0.aar 22782e58bdb0f0c4cfffb10f19b5c75f8b7355c10e21ac6a33a6161ab7a2dcab facebook-core-19.0.0.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-common/19.0.0/facebook-common-19.0.0.aar fedb3bec84d53d5866ac33aac4c190265fa5330c142a324bf809ce634ab67498 facebook-common-19.0.0.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-bolts/19.0.0/facebook-bolts-19.0.0.aar ce8e67054c959b451707507ad737bc2f4f166ac026d710f1af33999475878cc2 facebook-bolts-19.0.0.aar
https://repo1.maven.org/maven2/com/facebook/android/facebook-share/19.0.0/facebook-share-19.0.0.aar 0495c6b30643abc2e69e23790089330a90a1ace1e3d862f5e5887077380dcc8d facebook-share-19.0.0.aar
Loading
Loading