Skip to content

Commit

Permalink
Merge branch 'master' into f/go_router
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
dubydu committed Aug 30, 2024
2 parents fcac0bd + 6b99ef3 commit f46ed18
Show file tree
Hide file tree
Showing 12 changed files with 337 additions and 275 deletions.
92 changes: 60 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
branches: [ "master" ]

env:
FRB_MAIN_DART_VERSION: 3.2.0
FRB_MAIN_FLUTTER_VERSION: 3.19.1
FRB_MAIN_DART_VERSION: 3.5.1
FRB_MAIN_FLUTTER_VERSION: 3.24.1

jobs:
build:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
flutter: ["3.19.1"]
flutter: ["3.24.1"]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v2
Expand All @@ -53,32 +53,60 @@ jobs:
run: flutter build apk --flavor prod lib/main_prod.dart
working-directory: lib

# build-ios:
# name: Build ${{ matrix.package }} iOS on ${{ matrix.os }} with Xcode ${{ matrix.xcode }} and Flutter ${{ matrix.flutter }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [macos-14]
# xcode: ["15.2"]
# flutter: ["3.19.1"]
# exclude:
# - os: macos-13
# xcode: 14.3.1
# steps:
# - uses: actions/checkout@v1
# - uses: actions/setup-java@v1
# with:
# java-version: "12.x"
# - name: Xcode select
# run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ matrix.flutter }}
# - name: Flutter doctor (version check)
# run: flutter doctor
# - name: Build iOS
# run: flutter build ipa --flavor prod lib/main_prod.dart --export-method development
# working-directory: lib
# env:
# OTHER_SWIFT_FLAGS: "-warnings-as-errors"
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
build-ios:
name: Build ${{ matrix.package }} iOS on ${{ matrix.os }} with Xcode ${{ matrix.xcode }} and Flutter ${{ matrix.flutter }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
xcode: ["15.4"]
flutter: ["3.24.1"]
exclude:
- os: macos-13
xcode: 14.3.1
steps:
- uses: actions/checkout@v1
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: Xcode select
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter }}
- name: Flutter doctor (version check)
run: flutter doctor
- name: Build iOS
run: flutter build ipa --flavor prod lib/main_prod.dart --export-method development
working-directory: lib
env:
OTHER_SWIFT_FLAGS: "-warnings-as-errors"
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[![Build Status](https://app.bitrise.io/app/38259925b6bfe2bd/status.svg?token=7Q0InN8BEzmzxC0GPoddUg&branch=develop)](https://app.bitrise.io/app/38259925b6bfe2bd)
[![Build Status](https://github.com/dubydu/fluttourII/actions/workflows/ci.yml/badge.svg)](https://github.com/dubydu/fluttourII/actions/workflows/ci.yml)

A Flutter project template, an upgrade version of [`fluttour`](https://github.com/dubydu/fluttour)

### [Getting Started](#getting-started)

* Flutter (Channel stable, 3.19.4)
* Dart 3.3.2
* Flutter (Channel stable, 3.24.1)
* Dart 3.5.1
* Cocoapods 1.15.2

### [Article](#article)
Expand Down Expand Up @@ -154,8 +154,5 @@ A Flutter project template, an upgrade version of [`fluttour`](https://github.co
* Development: `flutter build [appbundle/apk] --flavor dev lib/main_dev.dart`
* Production: `flutter build [appbundle/apk] --flavor prod lib/main_prod.dart`

### [Troubleshooting](#troubleshooting)
- The connectivity always throw `none` result on iOS Simulator: [`> see this issue`](https://github.com/fluttercommunity/plus_plugins/issues/852)

### [Practice](#practice)
- [`Flutter x Magic Sliver Widgets`](https://github.com/dubydu/magic-sliver)
- [`Flutter x Magic Sliver Widgets`](https://github.com/dubydu/magic-sliver)
21 changes: 7 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,10 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
Expand Down Expand Up @@ -80,8 +77,4 @@ android {

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
}
17 changes: 2 additions & 15 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
11 changes: 2 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ PODS:
- connectivity_plus (0.0.1):
- Flutter
- FlutterMacOS
- ReachabilitySwift
- Flutter (1.0.0)
- ReachabilitySwift (5.2.1)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -14,10 +12,6 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)

SPEC REPOS:
trunk:
- ReachabilitySwift

EXTERNAL SOURCES:
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/darwin"
Expand All @@ -27,10 +21,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"

SPEC CHECKSUMS:
connectivity_plus: e2dad488011aeb593e219360e804c43cc1af5770
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
ReachabilitySwift: 5ae15e16814b5f9ef568963fb2c87aeb49158c66
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78

PODFILE CHECKSUM: c24c27344913105c54b95f33f73882923a0bd103

Expand Down
Loading

0 comments on commit f46ed18

Please sign in to comment.