Skip to content

Commit

Permalink
Finish upgrading to the latest version of Flutter.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Aug 31, 2024
1 parent 644a27c commit 1f28827
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 179 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ jobs:
needs: [cache-submodule]
runs-on: ubuntu-24.04

if: ${{ false }} # XXX: Flutter 3.24 --windows
steps:
- uses: actions/checkout@v4
- run: env/setup.sh
Expand Down
12 changes: 6 additions & 6 deletions app-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
jcenter()
mavenCentral()
}

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

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

Expand All @@ -30,12 +30,12 @@ apply plugin: 'kotlin-android'
def flutter = files(orcFlutter)

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
applicationId orcUnique
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionCode orcMonotonic.toInteger() - 946684800
versionName orcVersion
manifestPlaceholders = [orcUnique: orcUnique, orcName: orcName]
Expand Down
11 changes: 8 additions & 3 deletions app-flutter.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ $(call include,shared/target-all.mk)

$(foreach fork,$(forks),$(shell ln -sf $(patsubst %/pubspec.yaml,%,$(fork)) >/dev/null))

sed := $(shell which gsed sed | head -n1)

.PHONY: create
create: $(pwd/flutter)/packages/flutter/pubspec.lock
$(flutter) create -i objc -a java --no-pub --project-name orchid .
$(flutter) pub get
sed -ie 's/flutter\.compileSdkVersion/33/g;s/flutter.minSdkVersion/21/g' android/app/build.gradle
sed -ie "/^platform :osx/{s/,.*/, '10.15'/g;}" macos/Podfile
sed -ie "/MACOSX_DEPLOYMENT_TARGET =/{s/=.*/= 10.15;/g;}" macos/Runner.xcodeproj/project.pbxproj
$(sed) -ie 's/flutter\.compileSdkVersion/34/g;s/flutter.minSdkVersion/21/g' android/app/build.gradle
$(sed) -ie '0,/subprojects {/s//\0 afterEvaluate { android { compileSdkVersion 34 } }/' android/build.gradle
$(sed) -ie '/org\.jetbrains\.kotlin\.android/s/\(version "\)[^"]*/\11.8.0/' android/settings.gradle
$(sed) -ie "/^# platform :ios/{s/^# //;}" ios/Podfile
$(sed) -ie "/^platform :osx/{s/,.*/, '10.15'/;}" macos/Podfile
$(sed) -ie "/MACOSX_DEPLOYMENT_TARGET =/{s/=.*/= 10.15;/g;}" macos/Runner.xcodeproj/project.pbxproj

builds :=
builds += apk
Expand Down
8 changes: 6 additions & 2 deletions app-ios/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ $(call include,shared/target-ios.mk)
local :=
local += app.mm.o

local += $(subst %,.,$(word 1,$(generated))).o
temp := $(subst %,.,$(word 1,$(generated)))
local += $(temp).o

$(call depend,$(temp).o,$(output)/XCBuildData/build.db)
cflags/$(temp) += -fmodules $(patsubst %,-fmodule-map-file=%,$(wildcard $(output)/Release-$(sdk)/*/*.modulemap)) -Wno-ignored-attributes

include env/output.mk

Expand Down Expand Up @@ -139,7 +143,7 @@ $(bundle)/Assets.car: $(wildcard Assets.xcassets/*/*)
@mkdir -p $(output)/info
# XXX: --launch-image LaunchImage
actool --output-format human-readable-text --errors --warnings --notices \
--target-device iphone --target-device ipad --minimum-deployment-target 11.0 \
--target-device iphone --target-device ipad --minimum-deployment-target 12.0 \
--platform iphoneos \
--app-icon AppIcon \
--compress-pngs \
Expand Down
2 changes: 1 addition & 1 deletion app-shared/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ install! 'cocoapods',
:integrate_targets => false

# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
8 changes: 6 additions & 2 deletions app-shared/target-all.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ flutter := $(CURDIR)/$(pwd/flutter)/bin/flutter --suppress-analytics --verbose -

# -a is needed as flutter (incorrectly) only installs files for windows *target* on windows *host*
# https://github.com/flutter/flutter/issues/58379
precache := --android --ios --linux --macos --windows -a

# XXX: ugh. now I had to disable all the windows support due to Failed to download https://storage.googleapis.com/flutter_infra_release/flutter/b8800d88be4866db1b15f8b954ab2573bba9960f/windows-arm64/artifacts.zip. Ensure you have network connectivity and then try again. Exception: 404
# I actually think I can get them to fix this, as this breaks precache -a even without --windows and even without --enable-windows-desktop

precache := --android --ios --linux --macos #--windows

$(pwd/flutter)/packages/flutter/pubspec.lock: $(pwd/flutter)/packages/flutter/pubspec.yaml $(call head,$(pwd/flutter))
cd $(pwd/flutter) && git clean -fxd
cd $(pwd/flutter) && bin/flutter config --enable-linux-desktop
cd $(pwd/flutter) && bin/flutter config --enable-macos-desktop
cd $(pwd/flutter) && bin/flutter config --enable-windows-desktop
#cd $(pwd/flutter) && bin/flutter config --enable-windows-desktop
cd $(pwd/flutter) && bin/flutter precache $(precache)
cd $(pwd/flutter) && bin/flutter update-packages

Expand Down
3 changes: 2 additions & 1 deletion app-shared/target-and.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

assemble := android
platform := android
capped := Android

generated := $(pwd/gui)/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant%java

include $(pwd)/target-all.mk

jni := armeabi-v7a arm64-v8a
#jnis := $(subst $(space),$(comma),$(foreach arch,$(jni),android-$(flutter/$(arch))))

assembled := $(output)/flutter/flutter_assets/AssetManifest%json $(if $(filter noaot,$(debug)),,$(foreach arch,$(jni),$(output)/flutter/$(arch)/app%so))
$(assembled): $(dart)
Expand All @@ -35,6 +35,7 @@ $(assembled): $(dart)
-dTargetPlatform="$(platform)" \
-dTargetFile="lib/main.dart" \
-dBuildMode="$(mode)" \
-d$(capped)Archs="$(foreach arch,$(jni),$(flutter/$(arch)))" \
-dTreeShakeIcons="true" \
-dTrackWidgetCreation="true" \
--output="$(CURDIR)/$(output)/flutter" \
Expand Down
5 changes: 0 additions & 5 deletions app-shared/target-apl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ endif

codesign += && touch $(3)

ifeq ($(target),mac)
cflags += -F$(engine)
lflags += -F$(engine)
else
cflags += -F$(engine)/$(framework).xcframework/$(xcframework)
lflags += -F$(engine)/$(framework).xcframework/$(xcframework)
endif

app := $(bundle)$(contents)/Frameworks/App.framework
embed := $(bundle)$(contents)/Frameworks/$(framework).framework
Expand Down
2 changes: 1 addition & 1 deletion env/lnx-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

pacman -Sy \
ubuntu-keyring \
bc tcl vim \
bc sed tcl vim \
curl git rsync wget \
fakeroot talloc \
cpio rpm-tools unzip zstd \
Expand Down
2 changes: 1 addition & 1 deletion env/lnx-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apt-get update

apt-get -y install \
ubuntu-keyring \
bc tcl xxd \
bc sed tcl xxd \
curl git-core rsync wget \
fakeroot libtalloc-dev \
cpio rpm unzip zstd \
Expand Down
1 change: 1 addition & 0 deletions env/setup-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ which brew &>/dev/null || /bin/bash -c "$(curl -fsSL https://raw.githubuserconte

# XXX: duplicate linux setup as much as possible
brew install \
gnu-sed \
fakeroot \
rpm2cpio zstd \
binutils \
Expand Down
2 changes: 1 addition & 1 deletion env/setup-ndk.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -e
set -o pipefail
echo y | "${ANDROID_HOME}"/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.2" "ndk;26.3.11579264" "platforms;android-33" >/dev/null
echo y | "${ANDROID_HOME}"/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.2" "ndk;26.3.11579264" "platforms;android-34" >/dev/null
3 changes: 0 additions & 3 deletions env/target-apl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ signature := /_CodeSignature/CodeResources

isysroot := $(shell xcrun --sdk $(sdk) --show-sdk-path)
more += -isysroot $(isysroot)
ifneq ($(sdk),macosx)
more += -idirafter $(shell xcrun --sdk macosx --show-sdk-path)/usr/include
endif

define _
more/$(1) := -arch $(1)
Expand Down
2 changes: 2 additions & 0 deletions env/target-mac.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ runtime := osx
more := -mmacosx-version-min=10.15
include $(pwd)/target-apl.mk

xcframework := macos-arm64_x86_64

contents := /Contents
resources := /Resources
versions := /Versions/A
Loading

0 comments on commit 1f28827

Please sign in to comment.