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
16 changes: 16 additions & 0 deletions .github/workflows/google-foundation-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
- "source/Google/Places/**"
- "tests/E2E/Google.Foundation/**"
- "tools/e2e/check-consumer-shapes.sh"
- "tools/e2e/check-package-structure.sh"
- "tools/e2e/check-offline-build.sh"
- "tools/e2e/run-google-foundation.sh"
push:
branches:
Expand All @@ -32,6 +34,8 @@ on:
- "source/Google/Places/**"
- "tests/E2E/Google.Foundation/**"
- "tools/e2e/check-consumer-shapes.sh"
- "tools/e2e/check-package-structure.sh"
- "tools/e2e/check-offline-build.sh"
- "tools/e2e/run-google-foundation.sh"
workflow_dispatch:

Expand Down Expand Up @@ -75,12 +79,24 @@ jobs:
- name: Pack Google.Places
run: dotnet tool run dotnet-cake -- --target=nuget --names=Google.Places

- name: Package structure checks
run: >-
tools/e2e/check-package-structure.sh
--target Places
--package-dir output

- name: Direct and transitive consumer checks
run: >-
tools/e2e/check-consumer-shapes.sh
--target Places
--package-dir output

- name: Offline build proof
run: >-
tools/e2e/check-offline-build.sh
--target Places
--package-dir output

- name: Simulator E2E
run: >-
tools/e2e/run-google-foundation.sh
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ tools/e2e/*
!tools/e2e/run-firebase-foundation.sh
!tools/e2e/run-google-foundation.sh
!tools/e2e/check-consumer-shapes.sh
!tools/e2e/check-package-structure.sh
!tools/e2e/check-offline-build.sh
tmp-nugets
*.userprefs
*.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Firebase `12.10.0` is the current published Firebase package line.
| Package | Version |
| --- | --- |
| `Maps` | `9.2.0.8` |
| `Places` | `7.4.0.2` |
| `Places` | `7.4.0.3` |
| `SignIn` | `9.0.0` |

#### Google support packages (`AdamE.Google.iOS.*`)
Expand Down
2 changes: 2 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ Task ("externals")
FirebaseAnalyticsDownload ();
if (ARTIFACTS_TO_BUILD.Contains (GOOGLE_GOOGLE_APP_MEASUREMENT_ARTIFACT))
GoogleAppMeasurementDownload ();
if (ARTIFACTS_TO_BUILD.Contains (GOOGLE_PLACES_ARTIFACT))
GooglePlacesDownload ();
});

Task ("ci-setup")
Expand Down
6 changes: 4 additions & 2 deletions components.cake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Artifact GOOGLE_ANALYTICS_ARTIFACT = new Artifact ("Google.Analy
Artifact GOOGLE_CAST_ARTIFACT = new Artifact ("Google.Cast", "4.7.0.1", "15.0", ComponentGroup.Google, csprojName: "Cast");
Artifact GOOGLE_MAPS_ARTIFACT = new Artifact ("Google.Maps", "9.2.0.8", "15.0", ComponentGroup.Google, csprojName: "Maps");
Artifact GOOGLE_UMP_ARTIFACT = new Artifact ("Google.UserMessagingPlatform", "1.1.0.1", "15.0", ComponentGroup.Google, csprojName: "UserMessagingPlatform");
Artifact GOOGLE_PLACES_ARTIFACT = new Artifact ("Google.Places", "7.4.0.2", "15.0", ComponentGroup.Google, csprojName: "Places");
Artifact GOOGLE_PLACES_ARTIFACT = new Artifact ("Google.Places", "7.4.0.3", "15.0", ComponentGroup.Google, csprojName: "Places");
Artifact GOOGLE_APP_CHECK_CORE_ARTIFACT = new Artifact ("Google.AppCheckCore", "11.2.0.0", "15.0", ComponentGroup.Google, csprojName: "AppCheckCore");
Artifact GOOGLE_SIGN_IN_ARTIFACT = new Artifact ("Google.SignIn", "9.0.0.0", "15.0", ComponentGroup.Google, csprojName: "SignIn");
Artifact GOOGLE_TAG_MANAGER_ARTIFACT = new Artifact ("Google.TagManager", "9.2.0.0", "15.0", ComponentGroup.Google, csprojName: "TagManager");
Expand Down Expand Up @@ -225,8 +225,10 @@ void SetArtifactsPodSpecs ()
GOOGLE_UMP_ARTIFACT.PodSpecs = new [] {
PodSpec.Create ("GoogleUserMessagingPlatform", "1.1.0")
};
// The xcframework is fetched by GooglePlacesDownload() in custom_externals_download.cake
// rather than by a XamarinBuildDownload item in the .targets file.
GOOGLE_PLACES_ARTIFACT.PodSpecs = new [] {
PodSpec.Create ("GooglePlaces", "7.4.0")
PodSpec.Create ("GooglePlaces", "7.4.0", frameworkSource: FrameworkSource.Custom)
};
GOOGLE_SIGN_IN_ARTIFACT.PodSpecs = new [] {
PodSpec.Create ("GoogleSignIn", "9.0.0", frameworkSource: FrameworkSource.Pods),
Expand Down
33 changes: 31 additions & 2 deletions custom_externals_download.cake
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
class ExternalDownloadSource
{
// Most of these archives live under the Firebase analytics path, but Google publishes
// other SDKs under different hosts/paths, so the prefix is overridable.
const string DefaultUrlPrefix = "https://dl.google.com/firebase/ios/analytics";

public string Id { get; }
public string Version { get; }
public string ArchiveKey { get; }
public string UrlPrefix { get; }

public ExternalDownloadSource (string id, string version, string archiveKey)
public ExternalDownloadSource (string id, string version, string archiveKey, string urlPrefix = DefaultUrlPrefix)
{
Id = id;
Version = version;
ArchiveKey = archiveKey;
UrlPrefix = urlPrefix;
}

public string ArchiveFileName => $"{Id}-{Version}.tar.gz";
public string ExtractionRootName => $"{Id}-{Version}";
public string Url => $"https://dl.google.com/firebase/ios/analytics/{ArchiveKey}/{ArchiveFileName}";
public string Url => $"{UrlPrefix}/{ArchiveKey}/{ArchiveFileName}";
}

// *.tar.gz URLs can be found in the podspecs (e.g., CocoaPods Specs repo paths), such as:
// FirebaseAnalytics: https://github.com/CocoaPods/Specs/tree/master/Specs/e/2/1/FirebaseAnalytics
// GoogleAppMeasurement: https://github.com/CocoaPods/Specs/tree/master/Specs/e/3/b/GoogleAppMeasurement
// GooglePlaces: https://github.com/CocoaPods/Specs/tree/master/Specs/c/3/2/GooglePlaces
var ExternalDownloads = new Dictionary<string, ExternalDownloadSource> {
{ "FirebaseAnalytics", new ExternalDownloadSource ("FirebaseAnalytics", "12.10.0", "3c185b45848d98d8") },
{ "GoogleAppMeasurement", new ExternalDownloadSource ("GoogleAppMeasurement", "12.10.0", "5f5e4d8cb469941e") },
{ "GooglePlaces", new ExternalDownloadSource ("GooglePlaces", "7.4.0", "3e8dc2602895d53405d075ff4eb569bff93ff1af97e69915d1e657c07ef28dd8", "https://dl.google.com/dl/geosdk") },
};

FilePath GetArchivePath (ExternalDownloadSource source, DirectoryPath externalsPath) =>
Expand Down Expand Up @@ -97,6 +105,27 @@ void FirebaseAnalyticsDownload ()
});
}

void GooglePlacesDownload ()
{
var source = ExternalDownloads["GooglePlaces"];

DownloadAndExtract (
source,
() => DirectoryExists (new DirectoryPath ("./externals/GooglePlaces.xcframework")),
(extractionRoot, externalsPath, deleteSettings) => {
var frameworkSource = extractionRoot.Combine ("Frameworks").Combine ("GooglePlaces.xcframework");
var frameworkDestination = externalsPath.Combine ("GooglePlaces.xcframework");

if (!DirectoryExists (frameworkSource))
throw new Exception ($"Expected GooglePlaces.xcframework at {frameworkSource} after extraction.");

if (DirectoryExists (frameworkDestination))
DeleteDirectory (frameworkDestination, deleteSettings);

CopyDirectory (frameworkSource, frameworkDestination);
});
}

void GoogleAppMeasurementDownload ()
{
var source = ExternalDownloads["GoogleAppMeasurement"];
Expand Down
8 changes: 8 additions & 0 deletions source/Google/Places/Places.buildTransitive.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<!--
Transitive consumers get exactly the same logic as direct ones. Importing the build/ copy keeps
$(MSBuildThisFileDirectory) resolving to build/, which is where GooglePlaces.bundle is packed,
so the bundle only has to ship once.
-->
<Import Project="$(MSBuildThisFileDirectory)../build/AdamE.Google.iOS.Places.targets" />
</Project>
31 changes: 23 additions & 8 deletions source/Google/Places/Places.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<IsBindingProject>true</IsBindingProject>
<NoBindingEmbedding>false</NoBindingEmbedding>
<NoBindingEmbedding>true</NoBindingEmbedding>
<SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>
<RootNamespace>Google.Places</RootNamespace>
<AssemblyName>Google.Places</AssemblyName>
<AssemblyVersion>7.4.0.2</AssemblyVersion>
<FileVersion>7.4.0.2</FileVersion>
<AssemblyVersion>7.4.0.3</AssemblyVersion>
<FileVersion>7.4.0.3</FileVersion>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProcessEnums>true</ProcessEnums>
Expand All @@ -26,7 +26,7 @@
<PackageProjectUrl>https://github.com/AdamEssenmacher/GoogleApisForiOSComponents</PackageProjectUrl>
<PackageLicenseFile>License.md</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageVersion>7.4.0.2</PackageVersion>
<PackageVersion>7.4.0.3</PackageVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\AssemblyInfo.cs" />
Expand All @@ -36,15 +36,30 @@
</ItemGroup>
<ItemGroup>
<None Include="Places.targets" Pack="True" PackagePath="build/AdamE.Google.iOS.Places.targets" />
<None Include="Places.targets" Pack="True" PackagePath="buildTransitive/AdamE.Google.iOS.Places.targets" />
<None Include="Places.buildTransitive.targets" Pack="True" PackagePath="buildTransitive/AdamE.Google.iOS.Places.targets" />
<None Include="License.md" Pack="True" PackagePath="License.md" />
<None Include="../../../icons/googleiosplaces_128x128.png" Pack="True" PackagePath="googleiosplaces_128x128.png" />
</ItemGroup>
<ItemGroup>
<ObjcBindingApiDefinition Include="Enums.cs" />
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
<!--
GooglePlaces.xcframework is static, so the SDK does not copy its internal Resources into
consuming apps. Ship a standalone copy of the bundle next to the build/ targets file; the
targets file turns it into BundleResource items rooted at the app bundle.
-->
<None Include="..\..\..\externals\GooglePlaces.xcframework\ios-arm64\GooglePlaces.framework\Resources\GooglePlaces.bundle\**\*" Pack="True" PackagePath="build\GooglePlaces.bundle\%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<!-- Metadata mirrors what Places.targets declared before the package carried the xcframework. -->
<NativeReference Include="..\..\..\externals\GooglePlaces.xcframework">
<Kind>Framework</Kind>
<SmartLink>True</SmartLink>
<ForceLoad>True</ForceLoad>
<Frameworks>CoreGraphics CoreLocation QuartzCore Security UIKit</Frameworks>
<LinkerFlags>-ObjC</LinkerFlags>
</NativeReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" PrivateAssets="None" />
<ObjcBindingApiDefinition Include="Enums.cs" />
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
</ItemGroup>
</Project>
Loading
Loading