Skip to content

Commit

Permalink
Merge pull request #34 from auth0-samples/feature/macos-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket authored Dec 7, 2023
2 parents 1cc819a + 7a95150 commit eeaeaa9
Show file tree
Hide file tree
Showing 40 changed files with 2,007 additions and 187 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,38 @@ jobs:
with:
platform: ${{ env.platform }}
destination: 'platform=iOS Simulator,name=iPhone 15'

test-macos-smoke:
name: Run native macOS smoke tests using Xcode ${{ matrix.xcode }}
needs: authorize
runs-on: macos-13
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}

env:
platform: macOS
USER_EMAIL: ${{ secrets.USER_EMAIL }}
USER_PASSWORD: ${{ secrets.USER_PASSWORD }}

strategy:
matrix:
xcode:
- '15.0.1'

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up environment
uses: ./.github/actions/setup-darwin
with:
platform: ${{ env.platform }}
flutter: ${{ env.flutter }}
xcode: ${{ matrix.xcode }}
auth0-domain: ${{ vars.AUTH0_DOMAIN }}
auth0-client-id: ${{ vars.AUTH0_CLIENT_ID }}

- name: Run macOS smoke tests
uses: ./.github/actions/smoke-tests-darwin
with:
platform: ${{ env.platform }}
destination: platform=macOS,arch=x86_64
23 changes: 16 additions & 7 deletions sample/.metadata
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
channel: stable
revision: "b0366e0a3f089e15fd89c97604ab402fe26b724c"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
- platform: android
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
- platform: ios
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
- platform: macos
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
- platform: web
create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c

# User provided section

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.auth0.sample

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
2 changes: 1 addition & 1 deletion sample/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_ios_podfile_setup

target 'Runner' do
platform :ios, '12.0'
platform :ios, '13.0'
use_frameworks!
use_modular_headers!

Expand Down
44 changes: 0 additions & 44 deletions sample/ios/Podfile.lock

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
7 changes: 7 additions & 0 deletions sample/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Flutter-related
**/Flutter/ephemeral/
**/Pods/

# Xcode-related
**/dgph
**/xcuserdata/
2 changes: 2 additions & 0 deletions sample/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
2 changes: 2 additions & 0 deletions sample/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
14 changes: 14 additions & 0 deletions sample/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation

import auth0_flutter
import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
Auth0FlutterPlugin.register(with: registry.registrar(forPlugin: "Auth0FlutterPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
45 changes: 45 additions & 0 deletions sample/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
platform :osx, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))

target 'RunnerUITests' do
inherit! :search_paths
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
47 changes: 47 additions & 0 deletions sample/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
PODS:
- Auth0 (2.5.0):
- JWTDecode (~> 3.1)
- SimpleKeychain (~> 1.1)
- auth0_flutter (1.3.1):
- Auth0 (= 2.5.0)
- Flutter
- FlutterMacOS
- JWTDecode (= 3.1.0)
- SimpleKeychain (= 1.1.0)
- FlutterMacOS (1.0.0)
- JWTDecode (3.1.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- SimpleKeychain (1.1.0)

DEPENDENCIES:
- auth0_flutter (from `Flutter/ephemeral/.symlinks/plugins/auth0_flutter/darwin`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)

SPEC REPOS:
trunk:
- Auth0
- JWTDecode
- SimpleKeychain

EXTERNAL SOURCES:
auth0_flutter:
:path: Flutter/ephemeral/.symlinks/plugins/auth0_flutter/darwin
FlutterMacOS:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin

SPEC CHECKSUMS:
Auth0: 72f19ad566fdf57f07bf37f828afd0c1570769a5
auth0_flutter: 36047b3e7623feaadd0b0893903b730e0e1eddfa
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
JWTDecode: 3eaab1e06b6f4dcbdd6716aff09ba4c2104ca8b7
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
SimpleKeychain: f8707c8e97b38c6a6e687b17732afc9bcef06439

PODFILE CHECKSUM: a67b39594138394c7576fcbf46367d05f1b401ca

COCOAPODS: 1.14.3
Loading

0 comments on commit eeaeaa9

Please sign in to comment.