Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c09b353ee |
@@ -4,12 +4,13 @@ android {
|
||||
namespace = "io.ionic.starter"
|
||||
compileSdk = rootProject.ext.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "io.longtime.app"
|
||||
applicationId "io.demoapp.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
manifestPlaceholders = [googleMapsApiKey: System.getenv("VITE_GOOGLE_MAPS_KEY") ?: ""]
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
|
||||
@@ -25,11 +25,15 @@
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="io.longtime.app" />
|
||||
<data android:scheme="io.demoapp.app" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="${googleMapsApiKey}" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 804 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 771 B |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 804 B |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="splashBackground">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<string name="app_name">Longtime</string>
|
||||
<string name="title_activity_main">Longtime</string>
|
||||
<string name="app_name">DemoApp</string>
|
||||
<string name="title_activity_main">DemoApp</string>
|
||||
<string name="package_name">io.ionic.starter</string>
|
||||
<string name="custom_url_scheme">io.ionic.starter</string>
|
||||
</resources>
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
||||
<item name="android:background">@drawable/splash</item>
|
||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/splashBackground</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo</item>
|
||||
<item name="postSplashScreenTheme">@style/AppTheme.NoActionBar</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -15,5 +15,4 @@ ext {
|
||||
cordovaAndroidVersion = '14.0.1'
|
||||
rgcfaIncludeGoogle = true
|
||||
androidxCredentialsVersion = '1.3.0'
|
||||
javaVersion = JavaVersion.VERSION_17
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { CapacitorConfig } from '@capacitor/cli';
|
||||
|
||||
const config: CapacitorConfig = {
|
||||
appId: 'io.longtime.app',
|
||||
appName: 'Longtime',
|
||||
appId: 'io.demoapp.app',
|
||||
appName: 'DemoApp',
|
||||
webDir: 'dist',
|
||||
plugins: {
|
||||
FirebaseAuthentication: {
|
||||
|
||||
@@ -11,10 +11,29 @@ workflows:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
# Template ships with optional native plugins (maps, push, firebase auth) that most apps
|
||||
# won't use. Keeping unused plugins in package.json adds SPM/Gradle deps and bloats the
|
||||
# build. Strip any that have no import in src/ so only actually-used plugins are compiled.
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
# Delete package-lock.json (generated if user ever ran npm locally) so it doesn't
|
||||
# conflict with yarn.lock. --legacy-peer-deps silences peer dep warnings from older
|
||||
# Ionic/React packages that haven't updated their peerDependencies for React 18/19.
|
||||
- name: Install dependencies
|
||||
script: npm install --legacy-peer-deps
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
# Firebase config files are injected as base64 env vars by the Appcakes backend at
|
||||
# build time. Decode them here so cap sync and Gradle can pick them up. Optional —
|
||||
# builds without Firebase still succeed; native Firebase SDK just won't initialise.
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICES_JSON" ]; then
|
||||
@@ -27,6 +46,8 @@ workflows:
|
||||
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist
|
||||
echo "Wrote GoogleService-Info.plist ($(wc -c < ios/App/App/GoogleService-Info.plist) bytes)"
|
||||
fi
|
||||
# cap sync copies the built web assets (dist/) into android/app/src/main/assets/public/
|
||||
# and updates Capacitor plugin registrations in MainActivity. Must run after npm build.
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync android
|
||||
- name: Set up debug keystore
|
||||
@@ -62,8 +83,18 @@ workflows:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: npm install --legacy-peer-deps
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
@@ -99,8 +130,18 @@ workflows:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: npm install --legacy-peer-deps
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
@@ -136,8 +177,18 @@ workflows:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: npm install --legacy-peer-deps
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
@@ -174,28 +225,39 @@ workflows:
|
||||
node: 22
|
||||
xcode: latest
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: npm install --legacy-peer-deps
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
# First sync: regenerates CapApp-SPM/Package.swift with the correct plugin list.
|
||||
# Note: this project uses Capacitor SPM (no CocoaPods/Podfile), so cap sync replaces
|
||||
# pod install — it regenerates CapApp-SPM/Package.swift and copies web assets.
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
# Decode Firebase plist to disk so it is present during the second sync.
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then
|
||||
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist
|
||||
ruby -e "
|
||||
require 'xcodeproj'
|
||||
project = Xcodeproj::Project.open('ios/App/App.xcodeproj')
|
||||
target = project.targets.find { |t| t.name == 'App' }
|
||||
app_group = project.main_group['App']
|
||||
unless app_group.files.find { |f| f.path == 'GoogleService-Info.plist' }
|
||||
file_ref = app_group.new_reference('GoogleService-Info.plist')
|
||||
target.resources_build_phase.add_file_reference(file_ref)
|
||||
project.save
|
||||
end
|
||||
"
|
||||
fi
|
||||
# Second sync ensures CapApp-SPM/Package.swift is consistent after the plist write.
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
# Run configure_xcode.rb after both syncs so its xcodeproj changes (plist file
|
||||
# reference + SPM product linking) are not overwritten by a subsequent cap sync.
|
||||
# configure_xcode.rb is stamped fresh from template on every build push.
|
||||
- name: Configure Xcode project
|
||||
script: ruby configure_xcode.rb
|
||||
- name: Set up signing
|
||||
script: |
|
||||
keychain initialize
|
||||
@@ -220,11 +282,23 @@ workflows:
|
||||
echo "No signing credentials configured — build will fail at signing"
|
||||
exit 1
|
||||
fi
|
||||
# --workspace: Capacitor SPM projects require workspace context for Xcode to resolve
|
||||
# the CapApp-SPM local package. Using --project causes xcodebuild to fail on
|
||||
# Xcode 26+ because SPM resolution requires workspace scope. App.xcworkspace is a
|
||||
# static file committed to the template (not generated by cap sync) that wraps
|
||||
# App.xcodeproj for this purpose.
|
||||
# --no-show-build-settings: xcode-project runs xcodebuild -showBuildSettings as a
|
||||
# pre-build diagnostic. Xcode 26 fails this step for SPM projects even with
|
||||
# --workspace, so we skip it. The actual archive step still surfaces real errors.
|
||||
# --disable-xcpretty: xcpretty reformats and filters xcodebuild output, swallowing
|
||||
# the actual error lines when a build fails. Raw output makes failures debuggable.
|
||||
- name: Build IPA
|
||||
script: |
|
||||
xcode-project build-ipa \
|
||||
--project ios/App/App.xcodeproj \
|
||||
--scheme App
|
||||
--workspace ios/App/App.xcworkspace \
|
||||
--scheme App \
|
||||
--no-show-build-settings \
|
||||
--disable-xcpretty
|
||||
artifacts:
|
||||
- build/ios/ipa/*.ipa
|
||||
|
||||
@@ -236,28 +310,31 @@ workflows:
|
||||
node: 22
|
||||
xcode: latest
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: npm install --legacy-peer-deps
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
- name: Configure Xcode project
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then
|
||||
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist
|
||||
ruby -e "
|
||||
require 'xcodeproj'
|
||||
project = Xcodeproj::Project.open('ios/App/App.xcodeproj')
|
||||
target = project.targets.find { |t| t.name == 'App' }
|
||||
app_group = project.main_group['App']
|
||||
unless app_group.files.find { |f| f.path == 'GoogleService-Info.plist' }
|
||||
file_ref = app_group.new_reference('GoogleService-Info.plist')
|
||||
target.resources_build_phase.add_file_reference(file_ref)
|
||||
project.save
|
||||
end
|
||||
"
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
- name: Configure Xcode project
|
||||
script: ruby configure_xcode.rb
|
||||
- name: Set up signing
|
||||
script: |
|
||||
keychain initialize
|
||||
@@ -279,12 +356,16 @@ workflows:
|
||||
echo "$CM_PROVISIONING_PROFILE" | base64 --decode > "$HOME/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision"
|
||||
xcode-project use-profiles
|
||||
fi
|
||||
# See ios-debug Build IPA comments for --workspace, --no-show-build-settings,
|
||||
# and --disable-xcpretty rationale — same reasons apply here.
|
||||
- name: Build IPA
|
||||
script: |
|
||||
xcode-project build-ipa \
|
||||
--project ios/App/App.xcodeproj \
|
||||
--workspace ios/App/App.xcworkspace \
|
||||
--scheme App \
|
||||
--config Release
|
||||
--config Release \
|
||||
--no-show-build-settings \
|
||||
--disable-xcpretty
|
||||
- name: Publish
|
||||
script: |
|
||||
if [ "$SUBMIT_TO_TESTFLIGHT" = "true" ] || [ "$SUBMIT_TO_APP_STORE" = "true" ]; then
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
#!/usr/bin/env ruby
|
||||
# configure_xcode.rb — stamped fresh from template on every build (see gitea.service.ts)
|
||||
#
|
||||
# 1. Adds GoogleService-Info.plist to the Xcode target if present (xcodeproj gem)
|
||||
# 2. Scans Swift sources for Firebase imports and injects matching products into
|
||||
# CapApp-SPM/Package.swift — the correct approach for Capacitor SPM projects
|
||||
# where all native linking goes through CapApp-SPM, not App.xcodeproj directly.
|
||||
|
||||
require 'xcodeproj'
|
||||
|
||||
PROJECT_PATH = 'ios/App/App.xcodeproj'
|
||||
TARGET_NAME = 'App'
|
||||
PLIST_SRC = 'ios/App/App/GoogleService-Info.plist'
|
||||
CAP_APP_SPM = 'ios/App/CapApp-SPM/Package.swift'
|
||||
|
||||
# ── 1. GoogleService-Info.plist ───────────────────────────────────────────────
|
||||
if File.exist?(PLIST_SRC)
|
||||
project = Xcodeproj::Project.open(PROJECT_PATH)
|
||||
target = project.targets.find { |t| t.name == TARGET_NAME }
|
||||
if target
|
||||
app_group = project.main_group['App']
|
||||
unless app_group&.files&.find { |f| f.path == 'GoogleService-Info.plist' }
|
||||
file_ref = app_group.new_reference('GoogleService-Info.plist')
|
||||
target.resources_build_phase.add_file_reference(file_ref)
|
||||
project.save
|
||||
puts "Added GoogleService-Info.plist to target"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# ── 2. Scan Swift sources for Firebase imports ────────────────────────────────
|
||||
swift_files = Dir['ios/App/App/**/*.swift']
|
||||
firebase_imports = swift_files
|
||||
.flat_map { |f| File.readlines(f) rescue [] }
|
||||
.grep(/^\s*import\s+Firebase\w+/)
|
||||
.map { |l| l.strip.split(/\s+/).last }
|
||||
.uniq
|
||||
.sort
|
||||
|
||||
if firebase_imports.empty?
|
||||
puts "No Firebase imports found — skipping CapApp-SPM update"
|
||||
exit 0
|
||||
end
|
||||
|
||||
puts "Firebase imports detected: #{firebase_imports.join(', ')}"
|
||||
|
||||
unless File.exist?(CAP_APP_SPM)
|
||||
warn "WARNING: #{CAP_APP_SPM} not found — was cap sync run?"
|
||||
exit 0
|
||||
end
|
||||
|
||||
# ── 3. Detect firebase-ios-sdk URL and version from node_modules ──────────────
|
||||
# Read from the ACTUAL node_modules on this build machine (populated by npm install)
|
||||
# so the version we inject matches what @capacitor-firebase/* already resolved.
|
||||
firebase_url = nil
|
||||
firebase_version = nil
|
||||
|
||||
Dir['node_modules/@capacitor-firebase/**/Package.swift',
|
||||
'node_modules/@capacitor/push-notifications/**/Package.swift'].each do |f|
|
||||
content = File.read(f) rescue next
|
||||
url_m = content.match(/\.package\(url:\s*"(https:\/\/github\.com\/firebase\/firebase-ios-sdk[^"]*)"/)
|
||||
ver_m = content.match(/firebase-ios-sdk[^)]+from:\s*"(\d+)\.(\d+)\.(\d+)"/)
|
||||
next unless url_m && ver_m
|
||||
|
||||
firebase_url = url_m[1]
|
||||
major = ver_m[1].to_i
|
||||
firebase_version = "#{major}.0.0"
|
||||
puts "Detected firebase-ios-sdk from #{f}: url=#{firebase_url} → using from: \"#{firebase_version}\""
|
||||
break
|
||||
end
|
||||
|
||||
# Fallback — should rarely be needed
|
||||
unless firebase_url
|
||||
firebase_url = 'https://github.com/firebase/firebase-ios-sdk.git'
|
||||
firebase_version = '11.0.0'
|
||||
puts "Could not detect firebase-ios-sdk version from node_modules — using fallback #{firebase_version}"
|
||||
end
|
||||
|
||||
firebase_pkg = 'firebase-ios-sdk'
|
||||
|
||||
lines = File.read(CAP_APP_SPM).split("\n")
|
||||
|
||||
# ── 4. Inject firebase-ios-sdk as a direct package dependency if missing ──────
|
||||
# Normalise URL check to handle both with and without .git suffix
|
||||
firebase_url_base = firebase_url.sub(/\.git$/, '')
|
||||
unless lines.any? { |l| l.include?(firebase_url_base) }
|
||||
last_pkg_idx = lines.rindex { |l| l.include?('.package(') }
|
||||
if last_pkg_idx
|
||||
lines[last_pkg_idx] = lines[last_pkg_idx].rstrip
|
||||
lines[last_pkg_idx] += ',' unless lines[last_pkg_idx].end_with?(',')
|
||||
lines.insert(last_pkg_idx + 1,
|
||||
" .package(url: \"#{firebase_url}\", from: \"#{firebase_version}\")")
|
||||
puts "Added #{firebase_pkg} to CapApp-SPM package dependencies"
|
||||
else
|
||||
warn "WARNING: no .package( line found in #{CAP_APP_SPM} — cannot inject dependency"
|
||||
end
|
||||
end
|
||||
|
||||
# ── 5. Inject each detected product into the target dependencies if missing ───
|
||||
firebase_imports.each do |product|
|
||||
next if product == 'Firebase' # umbrella import — not a linkable SPM product
|
||||
|
||||
product_str = ".product(name: \"#{product}\", package: \"#{firebase_pkg}\")"
|
||||
next if lines.any? { |l| l.include?(product_str) }
|
||||
|
||||
last_prod_idx = lines.rindex { |l| l.include?('.product(') }
|
||||
if last_prod_idx
|
||||
lines[last_prod_idx] = lines[last_prod_idx].rstrip
|
||||
lines[last_prod_idx] += ',' unless lines[last_prod_idx].end_with?(',')
|
||||
lines.insert(last_prod_idx + 1, " #{product_str}")
|
||||
puts "Added #{product} to CapApp-SPM target dependencies"
|
||||
else
|
||||
warn "WARNING: no .product( line found in #{CAP_APP_SPM} — cannot inject #{product}"
|
||||
end
|
||||
end
|
||||
|
||||
File.write(CAP_APP_SPM, lines.join("\n"))
|
||||
puts "CapApp-SPM/Package.swift updated"
|
||||
@@ -308,7 +308,7 @@
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.longtime.app;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.demoapp.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -330,7 +330,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.longtime.app;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.demoapp.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:App.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,14 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
"images": [
|
||||
{
|
||||
"filename" : "AppIcon-512@2x.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
"idiom": "iphone",
|
||||
"scale": "1x",
|
||||
"size": "20x20",
|
||||
"filename": "icon-20.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "1x",
|
||||
"size": "20x20",
|
||||
"filename": "icon-20.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "1x",
|
||||
"size": "29x29",
|
||||
"filename": "icon-29.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "1x",
|
||||
"size": "29x29",
|
||||
"filename": "icon-29.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "1x",
|
||||
"size": "40x40",
|
||||
"filename": "icon-40.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"filename": "icon-40.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"filename": "icon-58.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"filename": "icon-58.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "3x",
|
||||
"size": "20x20",
|
||||
"filename": "icon-60.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "1x",
|
||||
"size": "76x76",
|
||||
"filename": "icon-76.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"filename": "icon-80.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"filename": "icon-80.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "3x",
|
||||
"size": "29x29",
|
||||
"filename": "icon-87.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "2x",
|
||||
"size": "60x60",
|
||||
"filename": "icon-120.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "3x",
|
||||
"size": "40x40",
|
||||
"filename": "icon-120.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "2x",
|
||||
"size": "76x76",
|
||||
"filename": "icon-152.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"scale": "2x",
|
||||
"size": "83.5x83.5",
|
||||
"filename": "icon-167.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"scale": "3x",
|
||||
"size": "60x60",
|
||||
"filename": "icon-180.png"
|
||||
},
|
||||
{
|
||||
"idiom": "ios-marketing",
|
||||
"scale": "1x",
|
||||
"size": "1024x1024",
|
||||
"filename": "icon-1024.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
"info": {
|
||||
"author": "appsuite",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 477 B |
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 993 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,23 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
"images": [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "splash-2732x2732-2.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "splash-2732x2732-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "splash-2732x2732.png",
|
||||
"scale" : "3x"
|
||||
"idiom": "universal",
|
||||
"filename": "splash.png",
|
||||
"scale": "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"info": {
|
||||
"author": "appsuite",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 154 KiB |
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Longtime</string>
|
||||
<string>DemoApp</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -51,10 +51,10 @@
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>io.longtime.app</string>
|
||||
<string>io.demoapp.app</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>io.longtime.app</string>
|
||||
<string>io.demoapp.app</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
@@ -0,0 +1,363 @@
|
||||
workflows:
|
||||
android-debug:
|
||||
name: Android – Debug APK
|
||||
max_build_duration: 45
|
||||
instance_type: mac_mini_m2
|
||||
environment:
|
||||
node: 22
|
||||
java: 21
|
||||
cache:
|
||||
cache_paths:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICES_JSON" ]; then
|
||||
echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json
|
||||
echo "Wrote google-services.json ($(wc -c < android/app/google-services.json) bytes)"
|
||||
else
|
||||
echo "GOOGLE_SERVICES_JSON is empty — skipping"
|
||||
fi
|
||||
if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then
|
||||
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist
|
||||
echo "Wrote GoogleService-Info.plist ($(wc -c < ios/App/App/GoogleService-Info.plist) bytes)"
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync android
|
||||
- name: Set up debug keystore
|
||||
script: |
|
||||
if [ -n "$CM_DEBUG_KEYSTORE" ]; then
|
||||
echo "$CM_DEBUG_KEYSTORE" | base64 --decode > /tmp/debug-keystore.p12
|
||||
fi
|
||||
- name: Build debug APK
|
||||
script: |
|
||||
cd android
|
||||
if [ -n "$CM_DEBUG_KEYSTORE" ]; then
|
||||
./gradlew assembleDebug \
|
||||
-Pandroid.injected.signing.store.file=/tmp/debug-keystore.p12 \
|
||||
-Pandroid.injected.signing.store.password=$CM_DEBUG_KEYSTORE_PASSWORD \
|
||||
-Pandroid.injected.signing.key.alias=debug \
|
||||
-Pandroid.injected.signing.key.password=$CM_DEBUG_KEYSTORE_PASSWORD \
|
||||
--no-daemon
|
||||
else
|
||||
./gradlew assembleDebug --no-daemon
|
||||
fi
|
||||
artifacts:
|
||||
- android/app/build/outputs/apk/debug/app-debug.apk
|
||||
|
||||
android-release-apk:
|
||||
name: Android – Release APK
|
||||
max_build_duration: 45
|
||||
instance_type: mac_mini_m2
|
||||
environment:
|
||||
node: 22
|
||||
java: 21
|
||||
cache:
|
||||
cache_paths:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICES_JSON" ]; then
|
||||
echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync android
|
||||
- name: Set up keystore
|
||||
script: echo "$CM_KEYSTORE" | base64 --decode > /tmp/keystore.jks
|
||||
- name: Build Release APK
|
||||
script: |
|
||||
cd android
|
||||
./gradlew assembleRelease \
|
||||
-Pandroid.injected.signing.store.file=/tmp/keystore.jks \
|
||||
-Pandroid.injected.signing.store.password=$CM_KEYSTORE_PASSWORD \
|
||||
-Pandroid.injected.signing.key.alias=$CM_KEY_ALIAS \
|
||||
-Pandroid.injected.signing.key.password=$CM_KEY_PASSWORD \
|
||||
--no-daemon
|
||||
artifacts:
|
||||
- android/app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
android-release-aab:
|
||||
name: Android – Release AAB
|
||||
max_build_duration: 45
|
||||
instance_type: mac_mini_m2
|
||||
environment:
|
||||
node: 22
|
||||
java: 21
|
||||
cache:
|
||||
cache_paths:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICES_JSON" ]; then
|
||||
echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync android
|
||||
- name: Set up keystore
|
||||
script: echo "$CM_KEYSTORE" | base64 --decode > /tmp/keystore.jks
|
||||
- name: Build Release AAB
|
||||
script: |
|
||||
cd android
|
||||
./gradlew bundleRelease \
|
||||
-Pandroid.injected.signing.store.file=/tmp/keystore.jks \
|
||||
-Pandroid.injected.signing.store.password=$CM_KEYSTORE_PASSWORD \
|
||||
-Pandroid.injected.signing.key.alias=$CM_KEY_ALIAS \
|
||||
-Pandroid.injected.signing.key.password=$CM_KEY_PASSWORD \
|
||||
--no-daemon
|
||||
artifacts:
|
||||
- android/app/build/outputs/bundle/release/app-release.aab
|
||||
|
||||
android-release:
|
||||
name: Android – Publish to Google Play
|
||||
max_build_duration: 60
|
||||
instance_type: mac_mini_m2
|
||||
environment:
|
||||
node: 22
|
||||
java: 21
|
||||
cache:
|
||||
cache_paths:
|
||||
- $HOME/.gradle/caches
|
||||
- $HOME/.gradle/wrapper
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICES_JSON" ]; then
|
||||
echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync android
|
||||
- name: Set up keystore
|
||||
script: echo "$CM_KEYSTORE" | base64 --decode > /tmp/keystore.jks
|
||||
- name: Build Release AAB
|
||||
script: |
|
||||
cd android
|
||||
./gradlew bundleRelease \
|
||||
-Pandroid.injected.signing.store.file=/tmp/keystore.jks \
|
||||
-Pandroid.injected.signing.store.password=$CM_KEYSTORE_PASSWORD \
|
||||
-Pandroid.injected.signing.key.alias=$CM_KEY_ALIAS \
|
||||
-Pandroid.injected.signing.key.password=$CM_KEY_PASSWORD \
|
||||
--no-daemon
|
||||
publishing:
|
||||
google_play:
|
||||
credentials: $GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS
|
||||
track: $GOOGLE_PLAY_TRACK
|
||||
submit_as_draft: false
|
||||
artifacts:
|
||||
- android/app/build/outputs/bundle/release/app-release.aab
|
||||
|
||||
ios-debug:
|
||||
name: iOS – Debug IPA
|
||||
max_build_duration: 60
|
||||
instance_type: mac_mini_m2
|
||||
environment:
|
||||
node: 22
|
||||
xcode: latest
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then
|
||||
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist
|
||||
ruby -e "
|
||||
require 'xcodeproj'
|
||||
project = Xcodeproj::Project.open('ios/App/App.xcodeproj')
|
||||
target = project.targets.find { |t| t.name == 'App' }
|
||||
app_group = project.main_group['App']
|
||||
unless app_group.files.find { |f| f.path == 'GoogleService-Info.plist' }
|
||||
file_ref = app_group.new_reference('GoogleService-Info.plist')
|
||||
target.resources_build_phase.add_file_reference(file_ref)
|
||||
project.save
|
||||
end
|
||||
"
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
- name: Set up signing
|
||||
script: |
|
||||
keychain initialize
|
||||
if [ -n "$APP_STORE_CONNECT_PRIVATE_KEY" ]; then
|
||||
app-store-connect fetch-signing-files \
|
||||
$(xcode-project detect-bundle-id) \
|
||||
--type IOS_APP_DEVELOPMENT \
|
||||
--certificate-key=@env:APP_STORE_CONNECT_PRIVATE_KEY \
|
||||
--issuer-id=$APP_STORE_CONNECT_ISSUER_ID \
|
||||
--key-id=$APP_STORE_CONNECT_KEY_IDENTIFIER \
|
||||
--create
|
||||
xcode-project use-profiles
|
||||
elif [ -n "$CM_CERTIFICATE" ]; then
|
||||
echo "$CM_CERTIFICATE" | base64 --decode > /tmp/cert.p12
|
||||
keychain add-certificates \
|
||||
--certificate /tmp/cert.p12 \
|
||||
--certificate-password "$CM_CERTIFICATE_PASSWORD"
|
||||
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
|
||||
echo "$CM_PROVISIONING_PROFILE" | base64 --decode > "$HOME/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision"
|
||||
xcode-project use-profiles
|
||||
else
|
||||
echo "No signing credentials configured — build will fail at signing"
|
||||
exit 1
|
||||
fi
|
||||
- name: Build IPA
|
||||
script: |
|
||||
xcode-project build-ipa \
|
||||
--workspace ios/App/App.xcworkspace \
|
||||
--scheme App
|
||||
artifacts:
|
||||
- build/ios/ipa/*.ipa
|
||||
|
||||
ios-release:
|
||||
name: iOS – Release IPA
|
||||
max_build_duration: 90
|
||||
instance_type: mac_mini_m2
|
||||
environment:
|
||||
node: 22
|
||||
xcode: latest
|
||||
scripts:
|
||||
- name: Strip unused scaffold packages
|
||||
script: |
|
||||
for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do
|
||||
if ! grep -rq "$pkg" src/; then
|
||||
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));"
|
||||
echo "Stripped $pkg (not used in src/)"
|
||||
else
|
||||
echo "Keeping $pkg (used in src/)"
|
||||
fi
|
||||
done
|
||||
- name: Install dependencies
|
||||
script: rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
- name: Build web assets
|
||||
script: npm run build
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
- name: Write Firebase config
|
||||
script: |
|
||||
if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then
|
||||
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist
|
||||
ruby -e "
|
||||
require 'xcodeproj'
|
||||
project = Xcodeproj::Project.open('ios/App/App.xcodeproj')
|
||||
target = project.targets.find { |t| t.name == 'App' }
|
||||
app_group = project.main_group['App']
|
||||
unless app_group.files.find { |f| f.path == 'GoogleService-Info.plist' }
|
||||
file_ref = app_group.new_reference('GoogleService-Info.plist')
|
||||
target.resources_build_phase.add_file_reference(file_ref)
|
||||
project.save
|
||||
end
|
||||
"
|
||||
fi
|
||||
- name: Capacitor sync
|
||||
script: npx cap sync ios
|
||||
- name: Set up signing
|
||||
script: |
|
||||
keychain initialize
|
||||
if [ -n "$APP_STORE_CONNECT_PRIVATE_KEY" ]; then
|
||||
app-store-connect fetch-signing-files \
|
||||
$(xcode-project detect-bundle-id) \
|
||||
--type IOS_APP_STORE \
|
||||
--certificate-key=@env:APP_STORE_CONNECT_PRIVATE_KEY \
|
||||
--issuer-id=$APP_STORE_CONNECT_ISSUER_ID \
|
||||
--key-id=$APP_STORE_CONNECT_KEY_IDENTIFIER \
|
||||
--create
|
||||
xcode-project use-profiles
|
||||
else
|
||||
echo "$CM_CERTIFICATE" | base64 --decode > /tmp/cert.p12
|
||||
keychain add-certificates \
|
||||
--certificate /tmp/cert.p12 \
|
||||
--certificate-password "$CM_CERTIFICATE_PASSWORD"
|
||||
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
|
||||
echo "$CM_PROVISIONING_PROFILE" | base64 --decode > "$HOME/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision"
|
||||
xcode-project use-profiles
|
||||
fi
|
||||
- name: Build IPA
|
||||
script: |
|
||||
xcode-project build-ipa \
|
||||
--workspace ios/App/App.xcworkspace \
|
||||
--scheme App \
|
||||
--config Release
|
||||
- name: Publish
|
||||
script: |
|
||||
if [ "$SUBMIT_TO_TESTFLIGHT" = "true" ] || [ "$SUBMIT_TO_APP_STORE" = "true" ]; then
|
||||
app-store-connect publish \
|
||||
--certificate-key=@env:APP_STORE_CONNECT_PRIVATE_KEY \
|
||||
--issuer-id=$APP_STORE_CONNECT_ISSUER_ID \
|
||||
--key-id=$APP_STORE_CONNECT_KEY_IDENTIFIER \
|
||||
--submit-to-testflight=$SUBMIT_TO_TESTFLIGHT \
|
||||
--submit-to-app-store=$SUBMIT_TO_APP_STORE
|
||||
fi
|
||||
artifacts:
|
||||
- build/ios/ipa/*.ipa
|
||||
@@ -10,6 +10,7 @@
|
||||
"lint": "eslint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor-firebase/authentication": "^8.0.0",
|
||||
"@capacitor/android": "8.3.4",
|
||||
"@capacitor/app": "8.1.0",
|
||||
"@capacitor/core": "8.3.4",
|
||||
@@ -20,15 +21,16 @@
|
||||
"@capacitor/push-notifications": "^8.1.1",
|
||||
"@capacitor/status-bar": "8.0.2",
|
||||
"@ionic/pwa-elements": "^3.0.0",
|
||||
"@ionic/react": "^8.5.0",
|
||||
"@ionic/react-router": "^8.5.0",
|
||||
"@ionic/react": "8.8.7",
|
||||
"@ionic/react-router": "8.8.7",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"firebase": "^11.0.0",
|
||||
"ionicons": "^7.4.0",
|
||||
"katex": "^0.16.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.54.0",
|
||||
"react-katex": "^3.0.1",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"react-router": "^5.3.4",
|
||||
"react-router-dom": "^5.3.4",
|
||||
"zod": "^3.24.0",
|
||||
|
||||
@@ -1,32 +1,39 @@
|
||||
import React from "react";
|
||||
import { Redirect, Route } from "react-router-dom";
|
||||
import { IonApp, IonRouterOutlet } from "@ionic/react";
|
||||
import { IonReactRouter } from "@ionic/react-router";
|
||||
import React, { useEffect } from 'react';
|
||||
import { Redirect, Route } from 'react-router-dom';
|
||||
import { IonApp, IonRouterOutlet } from '@ionic/react';
|
||||
import { IonReactRouter } from '@ionic/react-router';
|
||||
import { setStatusBarStyle, Style } from './utils/statusBar';
|
||||
|
||||
import "@ionic/react/css/core.css";
|
||||
import "@ionic/react/css/normalize.css";
|
||||
import "@ionic/react/css/structure.css";
|
||||
import "@ionic/react/css/typography.css";
|
||||
import "@ionic/react/css/padding.css";
|
||||
import "@ionic/react/css/float-elements.css";
|
||||
import "@ionic/react/css/text-alignment.css";
|
||||
import "@ionic/react/css/text-transformation.css";
|
||||
import "@ionic/react/css/flex-utils.css";
|
||||
import "@ionic/react/css/display.css";
|
||||
import '@ionic/react/css/core.css';
|
||||
import '@ionic/react/css/normalize.css';
|
||||
import '@ionic/react/css/structure.css';
|
||||
import '@ionic/react/css/typography.css';
|
||||
import '@ionic/react/css/padding.css';
|
||||
import '@ionic/react/css/float-elements.css';
|
||||
import '@ionic/react/css/text-alignment.css';
|
||||
import '@ionic/react/css/text-transformation.css';
|
||||
import '@ionic/react/css/flex-utils.css';
|
||||
import '@ionic/react/css/display.css';
|
||||
|
||||
import "./theme/variables.css";
|
||||
import './theme/variables.css';
|
||||
|
||||
import Home from "./pages/Home";
|
||||
import Home from './pages/Home';
|
||||
|
||||
const App: React.FC = () => (
|
||||
<IonApp>
|
||||
<IonReactRouter>
|
||||
<IonRouterOutlet>
|
||||
<Route path="/home" component={Home} exact />
|
||||
<Redirect exact from="/" to="/home" />
|
||||
</IonRouterOutlet>
|
||||
</IonReactRouter>
|
||||
</IonApp>
|
||||
);
|
||||
const App: React.FC = () => {
|
||||
useEffect(() => {
|
||||
setStatusBarStyle(Style.Light);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<IonApp>
|
||||
<IonReactRouter>
|
||||
<IonRouterOutlet>
|
||||
<Route path="/home" component={Home} exact />
|
||||
<Route exact path="/" render={() => <Redirect to="/home" />} />
|
||||
</IonRouterOutlet>
|
||||
</IonReactRouter>
|
||||
</IonApp>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
const Hello = () => (
|
||||
<div>
|
||||
<p>Hello</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Hello;
|
||||
@@ -43,14 +43,8 @@ window.addEventListener('message', (e) => {
|
||||
|
||||
// Re-apply after React Fast Refresh so insets survive soft HMR cycles.
|
||||
if (import.meta.hot) {
|
||||
import.meta.hot.on('vite:beforeUpdate', () => {
|
||||
const c = (window as any).Ionic?.config;
|
||||
if (c) c.animated = false;
|
||||
});
|
||||
import.meta.hot.on('vite:afterUpdate', () => {
|
||||
_applyInsets(sessionStorage.getItem('__apsuite_sat'), sessionStorage.getItem('__apsuite_sab'));
|
||||
const c = (window as any).Ionic?.config;
|
||||
if (c) c.animated = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,17 +6,23 @@ import {
|
||||
IonTitle,
|
||||
IonToolbar,
|
||||
} from '@ionic/react';
|
||||
import Hello from '../components/Hello';
|
||||
|
||||
const Home: React.FC = () => (
|
||||
<IonPage>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonHeader translucent className="home-header">
|
||||
<IonToolbar className="home-toolbar">
|
||||
<IonTitle>Home</IonTitle>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
<IonContent className="ion-padding">
|
||||
<Hello />
|
||||
<IonContent fullscreen className="home-content">
|
||||
<div className="home-shell minimal-home-shell">
|
||||
<section className="minimal-welcome-card subtle-welcome-card">
|
||||
<h1>Welcome to your new app</h1>
|
||||
<p className="minimal-subtitle">
|
||||
Chat with the assistant to start adding features and pages
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
</IonContent>
|
||||
</IonPage>
|
||||
);
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
import type { Database } from './database.types';
|
||||
|
||||
export const supabase = createClient<Database>(
|
||||
'https://gsltltsypffowdpfdhkf.supabase.co',
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImdzbHRsdHN5cGZmb3dkcGZkaGtmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzk1Njg0MTIsImV4cCI6MjA5NTE0NDQxMn0.XH2adPZPr9p0fQwP3mXDP6wIS41DByW7ZAPSMA0_TYI',
|
||||
);
|
||||
@@ -1,65 +1,152 @@
|
||||
/* Ionic CSS Variables — customise to match your app's brand */
|
||||
:root {
|
||||
--ion-color-primary: #3880ff;
|
||||
--ion-color-primary-rgb: 56, 128, 255;
|
||||
--ion-color-primary: #5e6ad2;
|
||||
--ion-color-primary-rgb: 94, 106, 210;
|
||||
--ion-color-primary-contrast: #ffffff;
|
||||
--ion-color-primary-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-primary-shade: #3171e0;
|
||||
--ion-color-primary-tint: #4c8dff;
|
||||
--ion-color-primary-shade: #535db9;
|
||||
--ion-color-primary-tint: #6e79d7;
|
||||
|
||||
--ion-color-secondary: #3dc2ff;
|
||||
--ion-color-secondary-rgb: 61, 194, 255;
|
||||
--ion-color-secondary: #7a89f4;
|
||||
--ion-color-secondary-rgb: 122, 137, 244;
|
||||
--ion-color-secondary-contrast: #ffffff;
|
||||
--ion-color-secondary-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-secondary-shade: #36abe0;
|
||||
--ion-color-secondary-tint: #50c8ff;
|
||||
--ion-color-secondary-shade: #6b79d7;
|
||||
--ion-color-secondary-tint: #8895f5;
|
||||
|
||||
--ion-color-tertiary: #5260ff;
|
||||
--ion-color-tertiary-rgb: 82, 96, 255;
|
||||
--ion-color-tertiary: #8f78d8;
|
||||
--ion-color-tertiary-rgb: 143, 120, 216;
|
||||
--ion-color-tertiary-contrast: #ffffff;
|
||||
--ion-color-tertiary-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-tertiary-shade: #4854e0;
|
||||
--ion-color-tertiary-tint: #6370ff;
|
||||
--ion-color-tertiary-shade: #7e6ac0;
|
||||
--ion-color-tertiary-tint: #9a86dc;
|
||||
|
||||
--ion-color-success: #2dd36f;
|
||||
--ion-color-success-rgb: 45, 211, 111;
|
||||
--ion-color-success: #3aa67a;
|
||||
--ion-color-success-rgb: 58, 166, 122;
|
||||
--ion-color-success-contrast: #ffffff;
|
||||
--ion-color-success-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-success-shade: #28ba62;
|
||||
--ion-color-success-tint: #42d77d;
|
||||
--ion-color-success-shade: #33926b;
|
||||
--ion-color-success-tint: #4eb088;
|
||||
|
||||
--ion-color-warning: #ffc409;
|
||||
--ion-color-warning-rgb: 255, 196, 9;
|
||||
--ion-color-warning-contrast: #000000;
|
||||
--ion-color-warning-contrast-rgb: 0, 0, 0;
|
||||
--ion-color-warning-shade: #e0ac08;
|
||||
--ion-color-warning-tint: #ffca22;
|
||||
--ion-color-warning: #dfb25a;
|
||||
--ion-color-warning-rgb: 223, 178, 90;
|
||||
--ion-color-warning-contrast: #2d2520;
|
||||
--ion-color-warning-contrast-rgb: 45, 37, 32;
|
||||
--ion-color-warning-shade: #c49d4f;
|
||||
--ion-color-warning-tint: #e2bb6b;
|
||||
|
||||
--ion-color-danger: #eb445a;
|
||||
--ion-color-danger-rgb: 235, 68, 90;
|
||||
--ion-color-danger: #cf6679;
|
||||
--ion-color-danger-rgb: 207, 102, 121;
|
||||
--ion-color-danger-contrast: #ffffff;
|
||||
--ion-color-danger-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-danger-shade: #cf3c4f;
|
||||
--ion-color-danger-tint: #ed576b;
|
||||
--ion-color-danger-shade: #b65a6a;
|
||||
--ion-color-danger-tint: #d57587;
|
||||
|
||||
--ion-color-dark: #222428;
|
||||
--ion-color-dark-rgb: 34, 36, 40;
|
||||
--ion-color-dark: #1f2430;
|
||||
--ion-color-dark-rgb: 31, 36, 48;
|
||||
--ion-color-dark-contrast: #ffffff;
|
||||
--ion-color-dark-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-dark-shade: #1e2023;
|
||||
--ion-color-dark-tint: #383a3e;
|
||||
--ion-color-dark-shade: #1b202a;
|
||||
--ion-color-dark-tint: #353946;
|
||||
|
||||
--ion-color-medium: #92949c;
|
||||
--ion-color-medium-rgb: 146, 148, 156;
|
||||
--ion-color-medium: #7f8697;
|
||||
--ion-color-medium-rgb: 127, 134, 151;
|
||||
--ion-color-medium-contrast: #ffffff;
|
||||
--ion-color-medium-contrast-rgb: 255, 255, 255;
|
||||
--ion-color-medium-shade: #808289;
|
||||
--ion-color-medium-tint: #9d9fa6;
|
||||
--ion-color-medium-shade: #707686;
|
||||
--ion-color-medium-tint: #8c93a2;
|
||||
|
||||
--ion-color-light: #f4f5f8;
|
||||
--ion-color-light-rgb: 244, 245, 248;
|
||||
--ion-color-light-contrast: #000000;
|
||||
--ion-color-light-contrast-rgb: 0, 0, 0;
|
||||
--ion-color-light-shade: #d7d8da;
|
||||
--ion-color-light-tint: #f5f6f9;
|
||||
--ion-color-light: #f3f5fb;
|
||||
--ion-color-light-rgb: 243, 245, 251;
|
||||
--ion-color-light-contrast: #1f2430;
|
||||
--ion-color-light-contrast-rgb: 31, 36, 48;
|
||||
--ion-color-light-shade: #d6d8dd;
|
||||
--ion-color-light-tint: #f4f6fb;
|
||||
|
||||
--app-background: #ffffff;
|
||||
--app-surface: #ffffff;
|
||||
--app-surface-secondary: #f6f7fb;
|
||||
--app-text-primary: #202532;
|
||||
--app-text-secondary: rgba(32, 37, 50, 0.68);
|
||||
--app-text-tertiary: rgba(32, 37, 50, 0.46);
|
||||
--app-accent-soft: rgba(94, 106, 210, 0.12);
|
||||
--app-accent-softer: rgba(94, 106, 210, 0.08);
|
||||
--app-success-soft: rgba(58, 166, 122, 0.12);
|
||||
--app-shadow: 0 18px 48px rgba(82, 95, 140, 0.08);
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--app-background);
|
||||
color: var(--app-text-primary);
|
||||
}
|
||||
|
||||
ion-content.home-content {
|
||||
--background: var(--app-background);
|
||||
}
|
||||
|
||||
.home-toolbar {
|
||||
--background: rgba(255, 255, 255, 0.92);
|
||||
--border-width: 0;
|
||||
--border-color: transparent;
|
||||
--color: var(--app-text-primary);
|
||||
box-shadow: none;
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
ion-header.home-header::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.home-shell {
|
||||
padding: calc(88px + var(--ion-safe-area-top)) 24px
|
||||
calc(32px + var(--ion-safe-area-bottom));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.minimal-home-shell {
|
||||
min-height: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.minimal-welcome-card {
|
||||
text-align: left;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.subtle-welcome-card {
|
||||
max-width: 420px;
|
||||
margin: 0;
|
||||
padding: 28px 24px;
|
||||
background: var(--app-surface-secondary);
|
||||
border-radius: 28px;
|
||||
}
|
||||
|
||||
.minimal-welcome-card h1 {
|
||||
margin: 0;
|
||||
color: var(--app-text-primary);
|
||||
font-size: 32px;
|
||||
line-height: 1.12;
|
||||
letter-spacing: -0.03em;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.minimal-subtitle {
|
||||
margin: 0;
|
||||
color: var(--app-text-secondary);
|
||||
font-size: 15px;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
@media (min-width: 680px) {
|
||||
.home-shell {
|
||||
max-width: 720px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.minimal-welcome-card h1 {
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
ext {
|
||||
minSdkVersion = 24
|
||||
compileSdkVersion = 36
|
||||
targetSdkVersion = 36
|
||||
androidxActivityVersion = '1.11.0'
|
||||
androidxAppCompatVersion = '1.7.1'
|
||||
androidxCoordinatorLayoutVersion = '1.3.0'
|
||||
androidxCoreVersion = '1.17.0'
|
||||
androidxFragmentVersion = '1.8.9'
|
||||
coreSplashScreenVersion = '1.2.0'
|
||||
androidxWebkitVersion = '1.14.0'
|
||||
junitVersion = '4.13.2'
|
||||
androidxJunitVersion = '1.3.0'
|
||||
androidxEspressoCoreVersion = '3.7.0'
|
||||
cordovaAndroidVersion = '14.0.1'
|
||||
rgcfaIncludeGoogle = true
|
||||
androidxCredentialsVersion = '1.3.0'
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
// NOTE: @ionic/react and @ionic/react-router are pinned to 8.8.7 in package.json.
|
||||
// 8.8.8 introduced a regression that breaks IonRouterOutlet page transition animations.
|
||||
// Do not upgrade until the upstream fix is confirmed.
|
||||
import { defineConfig, type Plugin } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
|
||||