Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/auto-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:

jobs:
auto-fix:
if: github.event.label.name == 'agent: create-pr' || github.event_name == 'workflow_dispatch'
if: "${{ github.event.label.name == 'agent: create-pr' || github.event_name == 'workflow_dispatch' }}"
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ secrets.properties

# This covers new IDEs, like Antigravity
.vscode/
.antigravitycli/
build-logic/**/bin/
19 changes: 19 additions & 0 deletions iosApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# CocoaPods
Pods/
Podfile.lock

# Xcode
build/
DerivedData/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
xcuserdata/
*.xcworkspace
!default.xcworkspace
*.xcuserstate

# Secrets
iosApp/DeveloperSecrets.swift

11 changes: 11 additions & 0 deletions iosApp/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
platform :ios, '16.0'

# Ignore warnings from CocoaPods dependencies
inhibit_all_warnings!

target 'iosApp' do
use_frameworks!

# Reference our local KMP module via its podspec path
pod 'maps_compose_multiplatform', :path => '../maps-compose-multiplatform'
end
71 changes: 71 additions & 0 deletions iosApp/create_project.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
require 'xcodeproj'

# Initialize project
project_path = 'iosApp.xcodeproj'
project = Xcodeproj::Project.new(project_path)

# Set deployment target to iOS 16.0 project-wide
project.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end

# Create group for source files (maps to the iosApp directory)
group = project.main_group.new_group('iosApp', 'iosApp')

# Reference source files inside the group
app_delegate_ref = group.new_file('AppDelegate.swift')
sample_list_ref = group.new_file('SampleListViewController.swift')
secrets_ref = group.new_file('DeveloperSecrets.swift')
info_plist_ref = group.new_file('Info.plist')

# Create target
target = project.new_target(:application, 'iosApp', :ios, '16.0')

# Configure target settings
target.build_configurations.each do |config|
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = 'com.google.maps.android.compose.iosApp'
config.build_settings['INFOPLIST_FILE'] = 'iosApp/Info.plist'
config.build_settings['SWIFT_VERSION'] = '5.0'
config.build_settings['SDKROOT'] = 'iphoneos'
config.build_settings['TARGETED_DEVICE_FAMILY'] = '1,2'
config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
config.build_settings['AD_HOC_CODE_SIGNING_ALLOWED'] = 'YES'
end

# Add a Build Phase Run Script to populate secrets before compilation
populate_secrets_phase = target.new_shell_script_build_phase('Populate Secrets')
populate_secrets_phase.shell_script = <<-SHELL
SECRETS_PATH="${PROJECT_DIR}/../secrets.properties"
OUTPUT_FILE="${SRCROOT}/iosApp/DeveloperSecrets.swift"

API_KEY="YOUR_API_KEY"

if [ -f "$SECRETS_PATH" ]; then
EXTRACTED_KEY=$(grep -E "^MAPS_API_KEY=" "$SECRETS_PATH" | cut -d'=' -f2 | tr -d '"' | tr -d "'")
if [ ! -z "$EXTRACTED_KEY" ]; then
API_KEY="$EXTRACTED_KEY"
fi
fi

cat <<EOF > "$OUTPUT_FILE"
// Generated file. Do not commit or modify.
struct DeveloperSecrets {
static let mapsApiKey = "$API_KEY"
}
EOF
SHELL

# Move the secrets phase to the very beginning of target build phases
target.build_phases.delete(populate_secrets_phase)
target.build_phases.insert(0, populate_secrets_phase)

# Add files to their respective build phases
source_build_phase = target.source_build_phase
source_build_phase.add_file_reference(app_delegate_ref)
source_build_phase.add_file_reference(sample_list_ref)
source_build_phase.add_file_reference(secrets_ref)

project.save
puts "Xcode project created successfully!"

Loading
Loading