Skip to content

Commit 70959e6

Browse files
authored
Add asmdef for the c# native codebases (#1439)
* Add asmdef for the c# native codebases * Allow the test apps to see the assembly * add test app def add allow internal access * Shuffle around for firebase AI * Don't need this for functions testing. * Add in missed asmdef * Include tweaks to the testing script and update readme * Update release notes
1 parent 79706f4 commit 70959e6

15 files changed

Lines changed: 143 additions & 2 deletions

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ python scripts/build_scripts/build_zips.py --platform=<target platform> --target
8787

8888
> **Note:** Supported library names: analytics, app_check, auth, crashlytics, database, firebaseai, firestore, functions, installations, messaging, remote_config, storage
8989
90+
## Unity Assembly Definitions (.asmdef)
91+
92+
For the assemblies written in C# where the code is directly included in the `unitypackage` or `tgz` (in the case of UPM), we use Unity Assembly Definitions (`.asmdef`). This is required for including pure C# code within Unity Package Manager (`.tgz`) packages.
93+
94+
For now, this is enabled for:
95+
- **Firebase AI** (`Firebase.FirebaseAI`)
96+
- **Functions** (`Firebase.Functions`)
97+
- **App Core** (`Firebase.App.Internal`)
98+
9099
## Packaging
91100

92101
We can package the built artifacts to better imported by Unity Editor.

app/src/internal/AssemblyInfo.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System.Runtime.CompilerServices;
2+
3+
// Grant native C# Unity packages access to Firebase.App's internal helpers
4+
[assembly: InternalsVisibleTo("Firebase.Functions")]
5+
[assembly: InternalsVisibleTo("Firebase.FirebaseAI")]
6+
[assembly: InternalsVisibleTo("Firebase.FirebaseAI.TestApp")]

app/src/internal/AssemblyInfo.cs.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Firebase.App.Internal",
3+
"rootNamespace": "Firebase.Internal",
4+
"references": [],
5+
"includePlatforms": [],
6+
"excludePlatforms": [],
7+
"allowUnsafeCode": false,
8+
"overrideReferences": true,
9+
"precompiledReferences": [
10+
"Firebase.App.dll",
11+
"Firebase.Platform.dll"
12+
],
13+
"autoReferenced": true,
14+
"defineConstraints": [],
15+
"versionDefines": [],
16+
"noEngineReferences": false
17+
}

app/src/internal/Firebase.App.Internal.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Release Notes
113113
- Changes
114114
- Firebase AI: Add support for Grounding with Google Maps.
115115
- Storage: Added `ListAsync` API to list items and prefixes under a reference.
116+
- Functions: Fixed tgz export, added missing asmdef for functions. Fixes issue where Functions were not being exported correctly in the tgz build.
117+
- Firebase AI: Fix tgz export, added missing asmdef for Firebase AI. Fixes issue where Firebase AI was not being exported correctly in the tgz build.
116118

117119
### 13.10.0
118120
- Changes

firebaseai/src/AssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
using System.Runtime.CompilerServices;
2+
[assembly: InternalsVisibleTo("Firebase.FirebaseAI.TestApp")]

firebaseai/src/AssemblyInfo.cs.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "Firebase.FirebaseAI",
3+
"rootNamespace": "Firebase.AI",
4+
"references": [
5+
"Firebase.App.Internal"
6+
],
7+
"includePlatforms": [],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": true,
11+
"precompiledReferences": [
12+
"Firebase.App.dll",
13+
"Firebase.Platform.dll",
14+
"Google.MiniJson.dll"
15+
],
16+
"autoReferenced": true,
17+
"defineConstraints": [],
18+
"versionDefines": [],
19+
"noEngineReferences": false
20+
}

firebaseai/src/Firebase.FirebaseAI.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)