diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 715698bb..7a165aab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ env: ROOT: "${{ github.workspace }}" SCRIPTS: "${{ github.workspace }}/.github/scripts" SERIOUS_PYTHON_SITE_PACKAGES: "${{ github.workspace }}/site-packages" + SERIOUS_PYTHON_APP: "${{ github.workspace }}/python-app" UV_PYTHON: "3.12" # futureware-tech/simulator-action upstream still declares node20 in # action.yml (no Node 24 release as of v5). Force the runner to execute @@ -64,12 +65,13 @@ jobs: fi bridge_example_macos: - name: Test Bridge example on macOS (Python ${{ matrix.python_version }}) + name: Test Bridge example on macOS (${{ matrix.build_system }}, Python ${{ matrix.python_version }}) runs-on: macos-26 strategy: fail-fast: false matrix: python_version: ['3.12', '3.13', '3.14'] + build_system: ['cocoapods', 'spm'] env: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: @@ -86,15 +88,34 @@ jobs: uses: actions/cache@v5 with: path: ~/.flet/cache - key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle.kts', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} restore-keys: | flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- flet-cache-${{ runner.os }}-${{ runner.arch }}- + - name: Configure ${{ matrix.build_system }} + run: | + if [ "${{ matrix.build_system }}" = "spm" ]; then + flutter config --enable-swift-package-manager + else + flutter config --no-enable-swift-package-manager + fi + - name: Package + run integration test working-directory: "src/serious_python/example/bridge_example" run: | + # SPM is the package command's default: it does host-side staging and + # writes the SP_NATIVE_SET cache-bust key (we export it into the build). + # CocoaPods opts out via SERIOUS_PYTHON_DARWIN_SPM=false; the podspec + # prepare_command stages then. (The SPM job leaves the var unset so it + # exercises the default path docs/readme commands use.) + if [ "${{ matrix.build_system }}" = "cocoapods" ]; then + export SERIOUS_PYTHON_DARWIN_SPM=false + fi dart run serious_python:main package app/src --platform Darwin --python-version ${{ matrix.python_version }} + if [ "${{ matrix.build_system }}" = "spm" ]; then + export SP_NATIVE_SET="$(cat build/.serious_python_spm_key)" + fi # Each test file is invoked separately. `flutter test integration_test` # over the directory reuses one VM session, but the second file's # `runApp()` then trips "Unable to start the app on the device" — @@ -106,13 +127,14 @@ jobs: flutter test integration_test/memory_test.dart -d macos --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} bridge_example_ios: - name: Test Bridge example on iOS (Python ${{ matrix.python_version }}) + name: Test Bridge example on iOS (${{ matrix.build_system }}, Python ${{ matrix.python_version }}) runs-on: macos-26 timeout-minutes: 25 strategy: fail-fast: false matrix: python_version: ['3.12', '3.13', '3.14'] + build_system: ['cocoapods', 'spm'] env: SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }} steps: @@ -129,7 +151,7 @@ jobs: uses: actions/cache@v5 with: path: ~/.flet/cache - key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle.kts', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} restore-keys: | flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- flet-cache-${{ runner.os }}-${{ runner.arch }}- @@ -144,17 +166,34 @@ jobs: shutdown_after_job: true wait_for_boot: true + - name: Configure ${{ matrix.build_system }} + run: | + if [ "${{ matrix.build_system }}" = "spm" ]; then + flutter config --enable-swift-package-manager + else + flutter config --no-enable-swift-package-manager + fi + - name: Package + run integration test working-directory: "src/serious_python/example/bridge_example" run: | ts() { date '+%H:%M:%S'; } + # SPM is the default; CocoaPods opts out (the SPM job leaves the var + # unset to exercise the default path docs/readme commands use). + if [ "${{ matrix.build_system }}" = "cocoapods" ]; then + export SERIOUS_PYTHON_DARWIN_SPM=false + fi echo "[$(ts)] >>> dart run serious_python:main package" # certifi is a placeholder requirement: serious_python_darwin's # sync_site_packages.sh only populates dist_ios/site-xcframeworks - # (which bundle-python-frameworks-ios.sh then requires at build - # time) when iOS-specific site-packages subdirs exist. Empty - # --requirements skips that branch and the build fails. + # (the iOS native C-extensions — embedded by the podspec script_phase + # under CocoaPods, or enumerated into extra-xcframeworks under SPM) + # when iOS-specific site-packages subdirs exist. Empty --requirements + # skips that branch and the build fails. dart run serious_python:main package app/src --platform iOS --python-version ${{ matrix.python_version }} --requirements certifi + if [ "${{ matrix.build_system }}" = "spm" ]; then + export SP_NATIVE_SET="$(cat build/.serious_python_spm_key)" + fi echo "[$(ts)] >>> flutter test integration_test (per-file)" # See macOS job for why each file runs as a separate invocation. flutter test integration_test/interactivity_test.dart --device-id ${{ steps.simulator.outputs.udid }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }} @@ -187,7 +226,7 @@ jobs: uses: actions/cache@v5 with: path: ~/.flet/cache - key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle.kts', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} restore-keys: | flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- flet-cache-${{ runner.os }}-${{ runner.arch }}- @@ -285,7 +324,7 @@ jobs: uses: actions/cache@v5 with: path: ~/.flet/cache - key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle.kts', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} restore-keys: | flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- flet-cache-${{ runner.os }}-${{ runner.arch }}- @@ -363,7 +402,7 @@ jobs: uses: actions/cache@v5 with: path: ~/.flet/cache - key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} + key: flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ hashFiles('src/serious_python/lib/src/python_versions.dart', 'src/serious_python/bin/package_command.dart', 'src/serious_python_android/android/build.gradle.kts', 'src/serious_python_darwin/darwin/prepare_macos.sh', 'src/serious_python_darwin/darwin/prepare_ios.sh', 'src/serious_python_windows/windows/CMakeLists.txt', 'src/serious_python_linux/linux/CMakeLists.txt') }} restore-keys: | flet-cache-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}- flet-cache-${{ runner.os }}-${{ runner.arch }}- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5079aed6..30967043 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,9 +10,9 @@ Bump version in: Bump `serious_python` dependency version with `flutter pub get` in example lock files: -* `src/serious_python/example/flet_example/pubspec.lock` * `src/serious_python/example/flask_example/pubspec.lock` * `src/serious_python/example/run_example/pubspec.lock` +* `src/serious_python/example/bridge_example/pubspec.lock` Update `CHANGELOG.md`. diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index ce5c0626..ab930e35 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -1,3 +1,11 @@ +## 4.0.0 + +* **App packaging lifted into serious_python.** Your Python app now ships **unpacked inside the application bundle**, next to the Python stdlib and site-packages, on macOS / iOS / Windows / Linux — no first-launch `app.zip` extraction. On **Android** the app ships as a *stored* `app.zip` asset inside the APK and is unpacked once (version-keyed) to the app-support files dir on the first launch after an install/update, like the existing `extract.zip`. Web (Pyodide) is unchanged. The `package` command stages the processed app into **`SERIOUS_PYTHON_APP`** (symmetric with `SERIOUS_PYTHON_SITE_PACKAGES`); each platform's native build copies it into the bundle (Android zips it as a stored asset). +* **New `SeriousPython.prepareApp()`** — materializes the app (Android first-launch unpack) and returns the directory containing its entry point. **`SeriousPython.run()` now takes no `assetPath` argument** (it resolves the app via `prepareApp()`), sets the current directory to a writable per-app data dir (`/data`) — not the read-only bundle — so relative file writes / SQLite work, and runs `main.pyc`/`main.py` (or `appFileName`). +* **Breaking change:** the `app.zip` asset convention and the runtime zip-extraction API are removed — `SeriousPython.run("app/app.zip")`, `extractAssetZip`, and `extractFileZip` no longer exist. Repackage with `dart run serious_python:main package -p ` and call `SeriousPython.run()` with no arguments. +* **Android:** the runtime payload moved to `/flet/{app, stdlib.zip, sitepackages.zip, extract/}` (resolved via `getApplicationSupportDirectory()`; the custom `getFilesDir` method channel is dropped). User data in the sibling `/data` survives app updates. +* **Swift Package Manager (darwin) staging in the `package` command — on by default.** For iOS/macOS the `package` command runs the host-side equivalent of the podspec `prepare_command` (which SPM has no hook for) by resolving `serious_python_darwin`'s `darwin/` dir (`SERIOUS_PYTHON_DARWIN_DIR` override, else the project's `package_config.json`), invoking `prepare_spm.sh`, and writing the `SP_NATIVE_SET` cache-bust key to `build/.serious_python_spm_key` (overridable via `SERIOUS_PYTHON_SPM_KEY_FILE`) for the caller to export into the `flutter build` environment. SPM is Flutter's default darwin integration since 3.44, so this happens by default — set **`SERIOUS_PYTHON_DARWIN_SPM`** to a falsy value (`0`/`false`/`no`/`off`) to opt out and build with CocoaPods (the podspec stages then). See `serious_python_darwin` 4.0.0. + ## 3.0.0 * **New in-process transport (dart_bridge FFI).** `SeriousPython.run` can now run the embedded interpreter **in-process** through the `dart_bridge` FFI bridge instead of talking to it over a socket. The Python lifecycle (initialize / run / teardown) is absorbed into the `dart_bridge` native library on every platform — `dart_bridge.xcframework` (iOS/macOS), `libdart_bridge.so` (Android/Linux), and `dart_bridge.dll` / `dart_bridge.pyd` (Windows) — and a new `PythonBridge` API exposes a MsgPack control channel plus dedicated binary data channels between Dart and Python. See the `bridge_example` app. The bundled `dart_bridge` is **1.4.0**. diff --git a/src/serious_python/README.md b/src/serious_python/README.md index c1834aab..80a0ad27 100644 --- a/src/serious_python/README.md +++ b/src/serious_python/README.md @@ -53,14 +53,6 @@ the auto-resolved default. ## Usage -Zip your Python app into `app.zip`, copy to `app` (or any other) directory in the root of your Flutter app and add it as an asset to `pubspec.yaml`: - -```yaml -flutter: - assets: - - app/app.zip -``` - Import Serious Python package into your app: `import 'package:serious_python/serious_python.dart';` @@ -72,24 +64,26 @@ The plugin is built against iOS 13.0, so you might need to update iOS version in platform :ios, '13.0' ``` -Create an instance of `SeriousPython` class and call its `run()` method: +Package your Python app with the CLI (see [Packaging Python app](#packaging-python-app) below). Its sources are placed **unpacked inside the app bundle**, next to the Python stdlib and site-packages — on Android they ship as a *stored* `app.zip` asset inside the APK and are unpacked once on first launch. Then run it: ```dart -SeriousPython.run("app/app.zip"); +SeriousPython.run(); ``` -When the app starts the archive is unpacked to a temporary directory and Serious Python plugin will try to run `main.py` in the root of the archive. Current directory is changed to a temporary directory. +`run()` resolves the packaged app, changes the current directory to a writable per-app data directory (`/data`), and runs `main.py` (or `main.pyc`) in the root of the app. + +> **Note:** the app directory is **read-only** inside the bundle (signed `.app`, iOS bundle, Program Files). Write your data — files, SQLite databases, etc. — under the current directory or another writable location, not next to your code. If your Python app has a different entry point it could be specified with `appFileName` parameter: ```dart -SeriousPython.run("app/app.zip", appFileName: "my_app.py"); +SeriousPython.run(appFileName: "my_app.py"); ``` You can pass a map with environment variables that should be available in your Python program: ```dart -SeriousPython.run("app/app.zip", +SeriousPython.run( appFileName: "my_app.py", environmentVariables: {"a": "1", "b": "2"}); ``` @@ -97,7 +91,7 @@ SeriousPython.run("app/app.zip", By default, Serious Python expects Python dependencies installed into `__pypackages__` directory in the root of app directory. You can add additional paths to look for 3rd-party packages using `modulePaths` parameter: ```dart -SeriousPython.run("app/app.zip", +SeriousPython.run( appFileName: "my_app.py", modulePaths: ["/absolute/path/to/my/site-packages"]); ``` @@ -105,9 +99,11 @@ SeriousPython.run("app/app.zip", By default the Python program runs in a background thread so the Flutter UI stays responsive. Pass `sync: true` to run it on the calling thread instead — useful for short utility programs or when calling from a Dart isolate; long-running synchronous programs will freeze the UI on the main isolate: ```dart -SeriousPython.run("app/app.zip", sync: true); +SeriousPython.run(sync: true); ``` +If you just need the path to the unpacked app (e.g. to drive the runtime yourself), call `SeriousPython.prepareApp()` — it returns the app directory, performing the one-time Android unpack if needed. + ### Packaging Python app > **Tip:** `serious_python` is also driven automatically by [`flet build`](https://flet.dev/docs/publish/), which threads `--python-version` and friends through for you. The instructions below cover direct standalone usage for non-Flet Flutter apps. @@ -128,28 +124,38 @@ dart run serious_python:main package app/src -p {platform} where `{platform}` can be one of the following: `Android`, `iOS`, `Darwin`, `Windows`, `Linux` or `Emscripten`. (`Darwin` covers both macOS apps and is the value used internally by `platform.system()` in the bundled Python; it is **not** spelled `macOS`.) -By default, the command creates `app/app.zip` asset, but you can change its path/name with `--asset` argument: +For **native** targets (`Android`, `iOS`, `Darwin`, `Windows`, `Linux`) the processed app is staged into the directory given by the `SERIOUS_PYTHON_APP` environment variable, and the platform's native build copies it into the app bundle (Android ships it as a *stored* `app.zip` asset, unpacked on first launch). For the **web** (`Emscripten`) target the command instead creates an `app/app.zip` asset (loaded by Pyodide in the browser); change its path/name with `--asset`: ``` -dart run serious_python:main package --asset assets/myapp.zip app/src -p {platform} +dart run serious_python:main package --asset assets/myapp.zip app/src -p Emscripten ``` #### Selecting a Python version -Pick which CPython line to bundle with `--python-version` (or set -`SERIOUS_PYTHON_VERSION` in the build environment): +Pick which CPython line to bundle with the **`SERIOUS_PYTHON_VERSION` +environment variable** (supported short versions today are **3.12**, **3.13**, +**3.14**; the default is the latest stable): ``` -dart run serious_python:main package app/src -p Android --python-version 3.13 -r flet +export SERIOUS_PYTHON_VERSION=3.13 +dart run serious_python:main package app/src -p Android -r flet ``` -Supported short versions today are **3.12**, **3.13**, **3.14**; the default -is the latest stable. The same env var (`SERIOUS_PYTHON_VERSION`) is also -read by each platform plugin's build script (`build.gradle`, the +`SERIOUS_PYTHON_VERSION` is read **in two places**: by the `package` command +above, and by each platform plugin's native build (`build.gradle`, the `serious_python_darwin` podspec, the Linux/Windows `CMakeLists.txt`) when -`flutter build` runs later, so a single `export` covers both the packaging -phase and the Flutter build phase. See the [Python versions](#python-versions) -table above for the matching CPython and Pyodide releases. +`flutter build` runs later. A single `export` covers both phases. + +> **Important:** the `package` command also accepts a `--python-version` flag, +> but it **only affects the `package` step** (which interpreter the +> site-packages are installed for) — it does **not** reach the later +> `flutter build`. Using the flag alone produces a **mismatched** app (e.g. +> 3.13 packages bundled with the default-latest `Python.framework` / runtime). +> For a manual two-step build, set the `SERIOUS_PYTHON_VERSION` env var so both +> phases agree. (`flet build` exports it for you.) + +See the [Python versions](#python-versions) table above for the matching CPython +and Pyodide releases. > **Note:** changing the bundled Python version for an app you've already built > requires a clean build (delete the app's `build/` directory, or run @@ -174,18 +180,17 @@ dart run serious_python:main package app/src -p iOS \ > The comma-separated form (`--requirements flet,numpy==2.1.1`) was removed in **0.9.2** as a breaking change so dependency specifiers containing `,` (like `pandas>=2.2,<3`) can be expressed; use the per-option form shown above instead. -To package for `iOS` and `Android` platforms developer should set `SERIOUS_PYTHON_SITE_PACKAGES` environment variable with a path to a temp directory for installed app packages. The contents of that directory is embedded into app bundle during app compilation. +For all **native** platforms (`iOS`, `Android`, `Darwin`, `Windows`, `Linux`) set the `SERIOUS_PYTHON_SITE_PACKAGES` environment variable to a directory for the installed `pip` packages, and `SERIOUS_PYTHON_APP` to a directory for the processed app sources. The platform's native build embeds both into the app bundle during compilation (your app sources unpacked next to `site-packages`). For example: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/app dart run serious_python:main package app/src -p iOS -r -r -r app/src/requirements.txt ``` -For macOS, Linux and Windows app packages are installed into `__pypackages__` inside app package asset zip. - -Make sure generated asset is added to `pubspec.yaml`. +For the **web** (`Emscripten`) target there is no `SERIOUS_PYTHON_APP`; the app and its `__pypackages__` are zipped into the `app/app.zip` asset instead — make sure it's added to `pubspec.yaml`. ## Python app structure @@ -212,7 +217,7 @@ Request additional packages for iOS and Android on [Flet Discussions - Packages] `dart run serious_python:main package` assembles two things, which the platform plugin then bundles into your Flutter app: 1. **The CPython runtime + standard library** — a per-target build downloaded from [flet-dev/python-build](https://github.com/flet-dev/python-build) (and, for native extensions, [mobile-forge](https://github.com/flet-dev/mobile-forge)) and bundled by the plugin at build time. -2. **Your app + its dependencies** — your Python sources are zipped into an **asset** (`app/app.zip` by default), and `pip`-installed packages are placed where each platform expects them. +2. **Your app + its dependencies** — your Python sources are placed **unpacked inside the app bundle**, next to the stdlib/site-packages (on Android they ship as a *stored* `app.zip` asset, and on the web inside `app/app.zip` — see below), and `pip`-installed packages are placed where each platform expects them. At runtime the plugin sets `PYTHONHOME` / `PYTHONPATH` (or, on Android, installs a custom importer) so the interpreter finds the stdlib, your dependencies, and your app. @@ -229,15 +234,15 @@ The on-disk layout differs per platform, mostly because each OS has different ru ### Your app program (all platforms) -`package` copies your Python sources into a temp dir (honoring `--exclude` globs, optionally compiling to `.pyc` with `--compile-app`), zips it to `app/app.zip` (override with `-a`/`--asset`), and writes an `app.zip.hash` next to it. At runtime the asset is extracted once to the app's support directory (`/flet/app`), guarded by a hash + an optional `invalidateKey` (typically your app version) so it only re-extracts when the bundle changes — debug builds always re-extract. Your app dir is placed first on `sys.path`; a sibling `__pypackages__/` is also added (so you can vendor pure-Python deps next to your code). +`package` copies your Python sources into a temp dir (honoring `--exclude` globs, optionally compiling to `.pyc` with `--compile-app`). For **native** platforms it stages them to `SERIOUS_PYTHON_APP`, and the platform build drops them **unpacked into the bundle** next to the stdlib/site-packages — `/app` (iOS/macOS), `/app` (Windows/Linux). There's no first-launch extraction; `SeriousPython.prepareApp()` just returns that path. On **Android** the sources are zipped into a *stored* `app.zip` asset and unpacked once (version-keyed by your app version) to `/flet/app` on the first launch after an install/update. On the **web** they're zipped into `app/app.zip` and loaded by Pyodide. Your app dir is placed first on `sys.path`; a sibling `__pypackages__/` is also added (so you can vendor pure-Python deps next to your code). At run time the current directory is set to a writable `/data` (the app dir itself is read-only). `pip install` output goes to `build/site-packages` by default (override with the `SERIOUS_PYTHON_SITE_PACKAGES` env var). For mobile, packages are installed **per architecture** (a `sitecustomize.py` shim spoofs the wheel platform tag so the correct mobile wheels resolve), then merged or split per platform as shown above. ### Android specifics -- **Pure Python** (stdlib + dependencies) ships in two **stored** (uncompressed) ABI-common zips — `stdlib.zip` and `sitepackages.zip` — copied once to the app's files dir and imported in place via `zipimport`. Final `sys.path` (highest first): your app dir, the extract dir, `sitepackages.zip`, `stdlib.zip`. +- **Pure Python** (stdlib + dependencies) ships in two **stored** (uncompressed) ABI-common zips — `stdlib.zip` and `sitepackages.zip` — copied once (version-keyed) to `/flet/` (alongside the unpacked `app/` and `extract/`) and imported in place via `zipimport`. Final `sys.path` (highest first): your app dir (`/flet/app`), the extract dir, `sitepackages.zip`, `stdlib.zip`. - **Native modules** (stdlib `lib-dynload` and site-package extensions) are relocated to `jniLibs//lib.so` and loaded **directly from the APK** (memory-mapped, never extracted to disk); a `sys.meta_path` finder resolves them from `.soref` markers left in the zips. This is why Android needs **no** `useLegacyPackaging` / `keepDebugSymbols` config and the stdlib is **not** duplicated per ABI. -- **Path-hungry packages** (those that read bundled data via `__file__` / `pkg_resources` rather than `importlib.resources`) can be shipped extracted to disk instead of inside the zip — list them (comma-separated relative paths) in `SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES`; they go into `extract.zip` and are unpacked to disk at first launch. +- **Path-hungry packages** (those that read bundled data via `__file__` / `pkg_resources` rather than `importlib.resources`) can be shipped extracted to disk instead of inside the zip — list them (comma-separated relative paths) in `SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES`; they go into `extract.zip` and are unpacked to disk at first launch. A plain entry matches that path or anything under it (`flask` → `flask/…`); an entry with a `*`/`?` **wildcard** is matched against the top-level name (`flask*` also catches the sibling `flask-.dist-info/`). - Works for both **single APK** (`flutter build apk`) and **Play Store App Bundles** (per-ABI config splits); under legacy packaging / `minSdk < 23` the same finder falls back to loading from the extracted `nativeLibraryDir`. ### iOS / macOS specifics @@ -263,18 +268,19 @@ The following matrix shows which platform you should build on to target specific ### macOS -macOS 10.15 (Catalina) is the minimal supported vesion of macOS. +macOS 11.0 (Big Sur) is the minimal supported version of macOS (the bundled +`Python.framework` requires 11.0). You have to update your Flutter app's `macos/Podfile` to have this line at the very top: ```ruby -platform :osx, '10.15' +platform :osx, '11.0' ``` Also, make sure `macos/Runner.xcodeproj/project.pbxproj` contains: ```objc -MACOSX_DEPLOYMENT_TARGET = 10.15; +MACOSX_DEPLOYMENT_TARGET = 11.0; ``` ### Android @@ -303,6 +309,4 @@ dart run serious_python:main package app/src -p Darwin --verbose [Python REPL with Flask backend](example/flask_example). -[Flet app](example/flet_example). - [Run Python app](example/run_example). diff --git a/src/serious_python/bin/package_command.dart b/src/serious_python/bin/package_command.dart index 474b824e..a3ed797a 100644 --- a/src/serious_python/bin/package_command.dart +++ b/src/serious_python/bin/package_command.dart @@ -20,10 +20,28 @@ const pyodideLockFile = "pyodide-lock.json"; const defaultSitePackagesDir = "__pypackages__"; const sitePackagesEnvironmentVariable = "SERIOUS_PYTHON_SITE_PACKAGES"; +// Staging dir for the processed app (copy/compile/cleanup output). When set, +// native platforms (macOS/iOS/Windows/Linux/Android) consume the unpacked app +// from here and do NOT receive an `app.zip` asset; web (Emscripten) still gets +// the zip. +const appEnvironmentVariable = "SERIOUS_PYTHON_APP"; const flutterPackagesFlutterEnvironmentVariable = "SERIOUS_PYTHON_FLUTTER_PACKAGES"; const allowSourceDistrosEnvironmentVariable = "SERIOUS_PYTHON_ALLOW_SOURCE_DISTRIBUTIONS"; +// Swift Package Manager (darwin) host-side staging. For iOS/macOS the package +// command runs the SPM equivalent of the podspec `prepare_command` — assembling +// the dist and mapping it into the plugin's Package.swift layout — since SPM has +// no pod-install hook. SPM is Flutter's default darwin integration since 3.44, so +// this happens **by default**; set `SERIOUS_PYTHON_DARWIN_SPM` to a falsy value +// (0/false/no/off) to opt out and build with CocoaPods (e.g. `flet build` sets it +// false when the app uses a non-SPM plugin). `SERIOUS_PYTHON_DARWIN_DIR` optionally +// overrides the resolved plugin `darwin/` dir; `SERIOUS_PYTHON_SPM_KEY_FILE` overrides +// where the SP_NATIVE_SET cache-bust key is written for the caller to export into the +// `flutter build` environment. +const darwinSpmEnvironmentVariable = "SERIOUS_PYTHON_DARWIN_SPM"; +const darwinDirEnvironmentVariable = "SERIOUS_PYTHON_DARWIN_DIR"; +const spmKeyFileEnvironmentVariable = "SERIOUS_PYTHON_SPM_KEY_FILE"; // Python runtime version data — `defaultPythonVersion`, `pythonReleases`, the // `*EnvironmentVariable` names, `dartBridgeVersion`, `pythonReleaseDate` — lives @@ -277,16 +295,17 @@ class PackageCommand extends Command { await _buildDir!.create(); } - // asset path + // asset path (only the web/Emscripten target produces an `app.zip` asset; + // native platforms stage the unpacked app to SERIOUS_PYTHON_APP instead, + // so they create neither the `app/` dir nor an `app.zip`). if (assetPath == null) { assetPath = "app/app.zip"; } else if (assetPath.startsWith("/") || assetPath.startsWith("\\")) { assetPath = assetPath.substring(1); } - // create dest dir final dest = File(path.join(currentPath, assetPath)); - if (!await dest.parent.exists()) { + if (isWeb && !await dest.parent.exists()) { stdout.writeln("Creating asset directory: ${dest.parent.path}"); await dest.parent.create(recursive: true); } @@ -334,6 +353,15 @@ class PackageCommand extends Command { } } + // app staging dir (native platforms only): when set, the processed app is + // copied here for the platform native build to place into the bundle, and + // no `app.zip` asset is produced. Web keeps the zip. + final appPackageRootEnv = Platform.environment[appEnvironmentVariable]; + final appPackageRoot = + (appPackageRootEnv != null && appPackageRootEnv.isNotEmpty) + ? appPackageRootEnv + : null; + // install requirements if (requirements.isNotEmpty && !skipSitePackages) { if (await Directory(sitePackagesRoot).exists()) { @@ -524,15 +552,43 @@ class PackageCommand extends Command { } } - // create archive - stdout.writeln( - "Creating app archive at ${dest.path} from a temp directory"); - await zipDirectoryPosix(tempDir, dest); + if (isWeb) { + // Web (Pyodide) still ships the app as a zip asset. + stdout.writeln( + "Creating app archive at ${dest.path} from a temp directory"); + await zipDirectoryPosix(tempDir, dest); - // create hash file - stdout.writeln("Writing app archive hash to ${dest.path}.hash"); - await File("${dest.path}.hash") - .writeAsString(await calculateFileHash(dest.path)); + // create hash file + stdout.writeln("Writing app archive hash to ${dest.path}.hash"); + await File("${dest.path}.hash") + .writeAsString(await calculateFileHash(dest.path)); + } else { + // Native platforms: stage the unpacked app for the platform native + // build to copy into the bundle (Android zips it as a stored asset). + if (appPackageRoot == null) { + throw Exception( + "$appEnvironmentVariable environment variable must be set for " + "$platform packaging (staging dir for the unpacked app)."); + } + final appStagingDir = Directory(appPackageRoot); + stdout.writeln("Staging unpacked app to ${appStagingDir.path}"); + if (await appStagingDir.exists()) { + await appStagingDir.delete(recursive: true); + } + await appStagingDir.create(recursive: true); + await copyDirectory(tempDir, appStagingDir, tempDir.path, []); + + // Swift Package Manager (darwin) host-side staging: the podspec + // prepare_command doesn't run under SPM, so assemble the dist and map it + // into the plugin's Package.swift layout here (app is now staged). SPM is + // Flutter's default darwin integration since 3.44, so this runs **by + // default**; set `SERIOUS_PYTHON_DARWIN_SPM` to a falsy value (0/false/ + // no/off) to opt out and build with CocoaPods (the podspec stages then). + if ((platform == "iOS" || platform == "Darwin") && + !_isFalsy(Platform.environment[darwinSpmEnvironmentVariable])) { + await _stageDarwinSpm(platform, currentPath); + } + } } catch (e) { stdout.writeln("Error: $e"); } finally { @@ -611,6 +667,65 @@ class PackageCommand extends Command { return proc.exitCode; } + static bool _isFalsy(String? v) => + v != null && const ["0", "false", "no", "off"].contains(v.toLowerCase()); + + // Run the darwin SPM staging (prepare_spm.sh: assemble dist + map into the + // plugin's Package.swift layout) and persist the SP_NATIVE_SET cache-bust key + // for `flet build` to export into the `flutter build` environment. + Future _stageDarwinSpm(String platform, String projectPath) async { + final darwinDir = await _resolveDarwinDir(projectPath); + if (darwinDir == null) { + stdout.writeln("SPM staging skipped: could not resolve serious_python_darwin " + "(set $darwinDirEnvironmentVariable or ensure " + ".dart_tool/package_config.json is present)."); + return; + } + final spmPlatform = platform == "iOS" ? "ios" : "macos"; + final script = path.join(darwinDir, "prepare_spm.sh"); + stdout.writeln("SPM: staging $spmPlatform via $script"); + final result = await Process.run("/bin/sh", [script, spmPlatform], + workingDirectory: darwinDir); + if ((result.stderr as String).isNotEmpty) { + verbose(result.stderr as String); + } + if (result.exitCode != 0) { + throw Exception("prepare_spm.sh failed (exit ${result.exitCode}):\n" + "${result.stderr}"); + } + // stage_spm.sh prints the key as its last stdout line. + final key = (result.stdout as String) + .trim() + .split("\n") + .where((l) => l.trim().isNotEmpty) + .last + .trim(); + final keyFile = Platform.environment[spmKeyFileEnvironmentVariable] ?? + path.join(projectPath, "build", ".serious_python_spm_key"); + await File(keyFile).parent.create(recursive: true); + await File(keyFile).writeAsString(key); + stdout.writeln("SPM: SP_NATIVE_SET=$key -> $keyFile"); + } + + // Resolve serious_python_darwin's `darwin/` directory — an explicit override + // (set by flet) wins, else read the flutter project's package config. + Future _resolveDarwinDir(String projectPath) async { + final override = Platform.environment[darwinDirEnvironmentVariable]; + if (override != null && override.isNotEmpty) return override; + final pc = + File(path.join(projectPath, ".dart_tool", "package_config.json")); + if (!await pc.exists()) return null; + final data = jsonDecode(await pc.readAsString()) as Map; + for (final pkg in (data["packages"] as List)) { + if (pkg["name"] == "serious_python_darwin") { + final base = Uri.directory(path.join(projectPath, ".dart_tool")); + final root = base.resolve(pkg["rootUri"] as String).toFilePath(); + return path.join(root, "darwin"); + } + } + return null; + } + Future zipDirectoryPosix(Directory source, File dest) async { final encoder = ZipFileEncoder(); encoder.create(dest.path); diff --git a/src/serious_python/example/README.md b/src/serious_python/example/README.md index 2d539ff6..4d2513e6 100644 --- a/src/serious_python/example/README.md +++ b/src/serious_python/example/README.md @@ -6,12 +6,6 @@ An exampe of using Flask to host app backend API written in Python. [Source](flask_example) -### Flet app - -An example of integrating [Flet widget](https://pub.dev/packages/flet) and [Flet framework](https://pypi.org/project/flet/) to easily create awesome Flutter apps in Python. - -[Source](flet_example) - ### Run app for integration tests A simple app that uses Python to save a random value into a text file and then read it back diff --git a/src/serious_python/example/bridge_example/.gitignore b/src/serious_python/example/bridge_example/.gitignore index 480a7ff6..df1ffd66 100644 --- a/src/serious_python/example/bridge_example/.gitignore +++ b/src/serious_python/example/bridge_example/.gitignore @@ -44,7 +44,4 @@ app.*.map.json /android/app/profile /android/app/release -# serious_python packaging artifacts (built by `dart run serious_python:main package`) -/app/app.zip -/app/app.zip.hash pubspec.lock diff --git a/src/serious_python/example/bridge_example/README.md b/src/serious_python/example/bridge_example/README.md index 3d045880..44a955de 100644 --- a/src/serious_python/example/bridge_example/README.md +++ b/src/serious_python/example/bridge_example/README.md @@ -17,11 +17,18 @@ Separating channels means the throughput / memory hot path is just `bridge.send` ```sh # From this directory: -dart run serious_python:main package app/src --platform Darwin \ - --python-version 3.14 +export SERIOUS_PYTHON_VERSION=3.14 # read by BOTH the package step and `flutter build` +export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/python-app +dart run serious_python:main package app/src --platform Darwin ``` -Substitute `Darwin` with `Linux`, `Windows`, `iOS`, or `Android`. Each platform plugin's CMake / Gradle pipeline downloads the prebuilt `dart_bridge` native binary from [flet-dev/dart-bridge](https://github.com/flet-dev/dart-bridge) at build time — no `--bridge` flag, no PyPI wheel. +Set `SERIOUS_PYTHON_VERSION` as an **environment variable** (not the `--python-version` +flag): the native build also reads it at `flutter run`/`flutter build` time, so a single +`export` keeps the bundled runtime and the installed packages on the same Python version. +`SERIOUS_PYTHON_APP` is where the processed app is staged for the platform build to +bundle (native targets ship the app unpacked next to the stdlib/site-packages — Android +ships it as a stored asset). Substitute `Darwin` with `Linux`, `Windows`, `iOS`, or `Android`. Each platform plugin's CMake / Gradle pipeline downloads the prebuilt `dart_bridge` native binary from [flet-dev/dart-bridge](https://github.com/flet-dev/dart-bridge) at build time — no `--bridge` flag, no PyPI wheel. ## Run diff --git a/src/serious_python/example/bridge_example/ios/.gitignore b/src/serious_python/example/bridge_example/ios/.gitignore index 7a7f9873..c2d46d88 100644 --- a/src/serious_python/example/bridge_example/ios/.gitignore +++ b/src/serious_python/example/bridge_example/ios/.gitignore @@ -21,7 +21,6 @@ Flutter/Flutter.podspec Flutter/Generated.xcconfig Flutter/ephemeral/ Flutter/app.flx -Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json diff --git a/src/serious_python/example/bridge_example/ios/Podfile.lock b/src/serious_python/example/bridge_example/ios/Podfile.lock index 3542b7d0..88e52bf8 100644 --- a/src/serious_python/example/bridge_example/ios/Podfile.lock +++ b/src/serious_python/example/bridge_example/ios/Podfile.lock @@ -1,22 +1,15 @@ PODS: - Flutter (1.0.0) - - serious_python_darwin (2.0.0): - - Flutter - - FlutterMacOS DEPENDENCIES: - Flutter (from `Flutter`) - - serious_python_darwin (from `.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: Flutter: :path: Flutter - serious_python_darwin: - :path: ".symlinks/plugins/serious_python_darwin/darwin" SPEC CHECKSUMS: Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e diff --git a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj index 42b493f2..28b7a207 100644 --- a/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/bridge_example/ios/Runner.xcodeproj/project.pbxproj @@ -205,8 +205,6 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - B2C65F2690B6BBEF6E20F674 /* [CP] Embed Pods Frameworks */, - 1D3A8F88F6DC96CBAD5977F8 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -284,23 +282,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1D3A8F88F6DC96CBAD5977F8 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -354,23 +335,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - B2C65F2690B6BBEF6E20F674 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; F3B1F0D1E68C4E672BCDCEAA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/src/serious_python/example/bridge_example/lib/main.dart b/src/serious_python/example/bridge_example/lib/main.dart index 9d7c995e..5db835f3 100644 --- a/src/serious_python/example/bridge_example/lib/main.dart +++ b/src/serious_python/example/bridge_example/lib/main.dart @@ -46,8 +46,8 @@ class BridgeExampleHandle { } /// Brief retry to cover the startup window where Python's handler hasn't - /// registered yet. Matches the pattern in flet_example's - /// `_DartBridgeBackendChannel._retrySend`. + /// registered yet. Matches the pattern in flet's build template + /// (`_DartBridgeBackendChannel._retrySend`). static void _retrySend(PythonBridge bridge, Uint8List bytes) { const interval = Duration(milliseconds: 50); const deadline = Duration(seconds: 30); @@ -75,7 +75,6 @@ void main() { // Fire-and-forget: Python's main.py blocks forever waiting for messages. // Awaiting SeriousPython.run() would deadlock the UI. unawaited(SeriousPython.run( - 'app/app.zip', environmentVariables: { _controlPortEnv: '${control.port}', _echoPortEnv: '${echo.port}', diff --git a/src/serious_python/example/bridge_example/macos/Podfile b/src/serious_python/example/bridge_example/macos/Podfile index ff5ddb3b..a46f7f23 100644 --- a/src/serious_python/example/bridge_example/macos/Podfile +++ b/src/serious_python/example/bridge_example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.15' +platform :osx, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/src/serious_python/example/bridge_example/macos/Podfile.lock b/src/serious_python/example/bridge_example/macos/Podfile.lock index 8a6bd931..1c915faa 100644 --- a/src/serious_python/example/bridge_example/macos/Podfile.lock +++ b/src/serious_python/example/bridge_example/macos/Podfile.lock @@ -1,23 +1,16 @@ PODS: - FlutterMacOS (1.0.0) - - serious_python_darwin (2.0.0): - - Flutter - - FlutterMacOS DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - - serious_python_darwin (from `Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral - serious_python_darwin: - :path: Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin SPEC CHECKSUMS: FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 - serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 -PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 +PODFILE CHECKSUM: 346bfb2deb41d4a6ebd6f6799f92188bde2d246f COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj index 8dda9eb0..76bfd1b1 100644 --- a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; B72E96C288A175DA4181F1E9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9E3AB6184BEAE07C5108EE3 /* Pods_Runner.framework */; }; E3DFE7ECAF91BB85499213B0 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0FC039480642B362225F49B /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ @@ -82,6 +83,7 @@ 39E5122CF63AF062558CE40F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 4DDC5FA0C150DCFDA5784BFA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7556ABD1A47FA4D65C4B0DFC /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 8B28C1B131F74EC8875EDFCF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; @@ -103,6 +105,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, B72E96C288A175DA4181F1E9 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -164,6 +167,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -240,8 +244,6 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 5019070AFE2F41F3F49E930B /* [CP] Embed Pods Frameworks */, - 583F80258F9FB1DB887F6668 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -249,6 +251,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* serious_python_bridge_example.app */; productType = "com.apple.product-type.application"; @@ -293,6 +298,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -362,40 +370,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 5019070AFE2F41F3F49E930B /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 583F80258F9FB1DB887F6668 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; BBA99A121B65ED7E52DABCEE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -575,7 +549,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -657,7 +631,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -707,7 +681,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -814,6 +788,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1fb7fdd6..79ee10d3 100644 --- a/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/src/serious_python/example/bridge_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + + + + + + + + + + + - - - diff --git a/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml b/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 3b5c35fb..00000000 --- a/src/serious_python/example/flet_example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/serious_python/example/flet_example/android/app/src/main/kotlin/com/example/flet_example/MainActivity.kt b/src/serious_python/example/flet_example/android/app/src/main/kotlin/com/example/flet_example/MainActivity.kt deleted file mode 100644 index 99464aea..00000000 --- a/src/serious_python/example/flet_example/android/app/src/main/kotlin/com/example/flet_example/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.flet_example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity : FlutterActivity() diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/drawable-v21/launch_background.xml b/src/serious_python/example/flet_example/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f3..00000000 --- a/src/serious_python/example/flet_example/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/drawable/launch_background.xml b/src/serious_python/example/flet_example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f8..00000000 --- a/src/serious_python/example/flet_example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b..00000000 Binary files a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79..00000000 Binary files a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d43914..00000000 Binary files a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d3..00000000 Binary files a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372ee..00000000 Binary files a/src/serious_python/example/flet_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/values-night/styles.xml b/src/serious_python/example/flet_example/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be7..00000000 --- a/src/serious_python/example/flet_example/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/src/serious_python/example/flet_example/android/app/src/main/res/values/styles.xml b/src/serious_python/example/flet_example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index cb1ef880..00000000 --- a/src/serious_python/example/flet_example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/src/serious_python/example/flet_example/android/app/src/profile/AndroidManifest.xml b/src/serious_python/example/flet_example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 399f6981..00000000 --- a/src/serious_python/example/flet_example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/src/serious_python/example/flet_example/android/build.gradle.kts b/src/serious_python/example/flet_example/android/build.gradle.kts deleted file mode 100644 index dbee657b..00000000 --- a/src/serious_python/example/flet_example/android/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -val newBuildDir: Directory = - rootProject.layout.buildDirectory - .dir("../../build") - .get() -rootProject.layout.buildDirectory.value(newBuildDir) - -subprojects { - val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) - project.layout.buildDirectory.value(newSubprojectBuildDir) -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean") { - delete(rootProject.layout.buildDirectory) -} diff --git a/src/serious_python/example/flet_example/android/gradle.properties b/src/serious_python/example/flet_example/android/gradle.properties deleted file mode 100644 index fbee1d8c..00000000 --- a/src/serious_python/example/flet_example/android/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError -android.useAndroidX=true diff --git a/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties b/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e4ef43fb..00000000 --- a/src/serious_python/example/flet_example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/src/serious_python/example/flet_example/android/settings.gradle.kts b/src/serious_python/example/flet_example/android/settings.gradle.kts deleted file mode 100644 index 24f70299..00000000 --- a/src/serious_python/example/flet_example/android/settings.gradle.kts +++ /dev/null @@ -1,29 +0,0 @@ -pluginManagement { - val flutterSdkPath = - run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.11.1" apply false - // KGP 2.3.21 required: Flet's transitive screen_brightness_android ships a - // Kotlin 2.3.x stdlib whose metadata can't be read by KGP < 2.3 (the 3.44.2 - // template default is 2.2.20). - id("org.jetbrains.kotlin.android") version "2.3.21" apply false -} - -include(":app") diff --git a/src/serious_python/example/flet_example/app/app.zip.hash b/src/serious_python/example/flet_example/app/app.zip.hash deleted file mode 100644 index e5d849b8..00000000 --- a/src/serious_python/example/flet_example/app/app.zip.hash +++ /dev/null @@ -1 +0,0 @@ -b92d604f99e8c64859bd16e28c24a0b25eefdcdcb35ba99a08201d614a03772a \ No newline at end of file diff --git a/src/serious_python/example/flet_example/app/src/main.py b/src/serious_python/example/flet_example/app/src/main.py deleted file mode 100644 index 05c566f1..00000000 --- a/src/serious_python/example/flet_example/app/src/main.py +++ /dev/null @@ -1,76 +0,0 @@ -import os -import sys -import urllib.request - -import flet as ft -from flet.version import flet_version - -# logging.basicConfig(level=logging.DEBUG) - -print("Hello from Python!") -print(__name__) - -# import aaa -app_data = os.environ["FLET_APP_DATA"] -app_temp = os.environ["FLET_APP_TEMP"] - - -def main(page: ft.Page): - page.title = "Flet counter example" - page.vertical_alignment = ft.MainAxisAlignment.CENTER - - py_ver = sys.version_info - python_version_text = ( - f"Python version: {py_ver.major}.{py_ver.minor}.{py_ver.micro}" - ) - print(python_version_text) - - txt_number = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100) - - def minus_click(e): - print("Clicked minus button") - txt_number.value = str(int(txt_number.value) - 1) - page.update() - - def plus_click(e): - txt_number.value = str(int(txt_number.value) + 1) - page.update() - - def check_ssl(e): - try: - with urllib.request.urlopen("https://google.com") as res: - result = "OK" - except Exception as ex: - result = str(ex) - page.show_dialog(ft.AlertDialog(content=ft.Text(result))) - # print(result) - - page.add( - ft.Row( - [ - ft.IconButton(ft.Icons.REMOVE, key="decrement", on_click=minus_click), - txt_number, - ft.IconButton(ft.Icons.ADD, key="increment", on_click=plus_click), - ], - alignment=ft.MainAxisAlignment.CENTER, - expand=True, - ), - ft.Row( - [ - ft.Text(f"Flet version: {flet_version}"), - ft.OutlinedButton("Check SSL", on_click=check_ssl), - ft.OutlinedButton("Exit app", on_click=lambda _: sys.exit(100)), - ], - wrap=True, - alignment=ft.MainAxisAlignment.CENTER, - ), - ft.Text(f"App data dir: {app_data}"), - ft.Text(f"App temp dir: {app_temp}"), - ft.Text(python_version_text), - ) - - print("This is inside main() method!") - - -if __name__ == "__main__": - ft.run(main) diff --git a/src/serious_python/example/flet_example/app/src/requirements.txt b/src/serious_python/example/flet_example/app/src/requirements.txt deleted file mode 100644 index 4c3173f6..00000000 --- a/src/serious_python/example/flet_example/app/src/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -flet \ No newline at end of file diff --git a/src/serious_python/example/flet_example/integration_test/app_test.dart b/src/serious_python/example/flet_example/integration_test/app_test.dart deleted file mode 100644 index 10b5574c..00000000 --- a/src/serious_python/example/flet_example/integration_test/app_test.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'package:flet_example/main.dart' as app; -import 'package:flutter/widgets.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('end-to-end test', () { - testWidgets('make sure counter can be incremented and decremented', - (tester) async { - app.main(); - await tester.pumpAndSettle(const Duration(seconds: 5)); - - // Wait for up to 10 seconds for the app to start - bool counterFound = false; - for (int i = 0; i < 20; i++) { - await tester.pump(const Duration(seconds: 1)); - - if (find.text('0').evaluate().isNotEmpty) { - counterFound = true; - break; - } - } - - expect(counterFound, isTrue); - - // Tap increment button - await tester.tap(find.byKey(const Key('increment'))); - await tester.pumpAndSettle(); - expect(find.text('1'), findsOneWidget); - - // Tap decrement button - await tester.tap(find.byKey(const Key('decrement'))); - await tester.tap(find.byKey(const Key('decrement'))); - await tester.pumpAndSettle(); - expect(find.text('-1'), findsOneWidget); - - // Verify the bundled Python runtime matches what CI requested. Skipped - // outside CI (no --dart-define). - const expectedPyVersion = - String.fromEnvironment('EXPECTED_PYTHON_VERSION'); - if (expectedPyVersion.isNotEmpty) { - bool versionFound = false; - for (int i = 0; i < 20; i++) { - await tester.pump(const Duration(seconds: 1)); - if (find - .textContaining('Python version: $expectedPyVersion.') - .evaluate() - .isNotEmpty) { - versionFound = true; - break; - } - } - expect(versionFound, isTrue, - reason: - 'Expected `Python version: $expectedPyVersion.x` in the app UI'); - } - }); - }); -} diff --git a/src/serious_python/example/flet_example/ios/.gitignore b/src/serious_python/example/flet_example/ios/.gitignore deleted file mode 100644 index 7a7f9873..00000000 --- a/src/serious_python/example/flet_example/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist b/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 391a902b..00000000 --- a/src/serious_python/example/flet_example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - diff --git a/src/serious_python/example/flet_example/ios/Flutter/Debug.xcconfig b/src/serious_python/example/flet_example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6f..00000000 --- a/src/serious_python/example/flet_example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/src/serious_python/example/flet_example/ios/Flutter/Release.xcconfig b/src/serious_python/example/flet_example/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bfe..00000000 --- a/src/serious_python/example/flet_example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/src/serious_python/example/flet_example/ios/Podfile b/src/serious_python/example/flet_example/ios/Podfile deleted file mode 100644 index e51a31d9..00000000 --- a/src/serious_python/example/flet_example/ios/Podfile +++ /dev/null @@ -1,44 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '13.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', '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 Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index c2fd4bea..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,620 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - 331C8081294A63A400263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C8080294A63A400263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C807D294A63A400263BE5 /* Sources */, - 331C807F294A63A400263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C8086294A63A400263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C8080294A63A400263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - 331C8080294A63A400263BE5 /* RunnerTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C807F294A63A400263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C807D294A63A400263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 331C8088294A63A400263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Debug; - }; - 331C8089294A63A400263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Release; - }; - 331C808A294A63A400263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C8088294A63A400263BE5 /* Debug */, - 331C8089294A63A400263BE5 /* Release */, - 331C808A294A63A400263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index e3773d42..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/flet_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/src/serious_python/example/flet_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/src/serious_python/example/flet_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift b/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift deleted file mode 100644 index c30b367e..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,16 +0,0 @@ -import Flutter -import UIKit - -@main -@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } - - func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { - GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) - } -} diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada47..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 7353c41e..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 797d452e..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index 6ed2d933..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cd7b009..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index fe730945..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index 321773cd..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 797d452e..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index 502f463a..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index 0ec30343..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index 0ec30343..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index e9f5fea2..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index 84ac32ae..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 8953cba0..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index 0467bf12..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2f..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/src/serious_python/example/flet_example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/src/serious_python/example/flet_example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/serious_python/example/flet_example/ios/Runner/Base.lproj/Main.storyboard b/src/serious_python/example/flet_example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/serious_python/example/flet_example/ios/Runner/Info.plist b/src/serious_python/example/flet_example/ios/Runner/Info.plist deleted file mode 100644 index 38b2b3d5..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Info.plist +++ /dev/null @@ -1,70 +0,0 @@ - - - - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Flet Example - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - flet_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneClassName - UIWindowScene - UISceneConfigurationName - flutter - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/src/serious_python/example/flet_example/ios/Runner/Runner-Bridging-Header.h b/src/serious_python/example/flet_example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a56..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/src/serious_python/example/flet_example/ios/Runner/SceneDelegate.swift b/src/serious_python/example/flet_example/ios/Runner/SceneDelegate.swift deleted file mode 100644 index b9ce8ea2..00000000 --- a/src/serious_python/example/flet_example/ios/Runner/SceneDelegate.swift +++ /dev/null @@ -1,6 +0,0 @@ -import Flutter -import UIKit - -class SceneDelegate: FlutterSceneDelegate { - -} diff --git a/src/serious_python/example/flet_example/ios/RunnerTests/RunnerTests.swift b/src/serious_python/example/flet_example/ios/RunnerTests/RunnerTests.swift deleted file mode 100644 index 86a7c3b1..00000000 --- a/src/serious_python/example/flet_example/ios/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Flutter -import UIKit -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/src/serious_python/example/flet_example/lib/main.dart b/src/serious_python/example/flet_example/lib/main.dart deleted file mode 100644 index fe0920df..00000000 --- a/src/serious_python/example/flet_example/lib/main.dart +++ /dev/null @@ -1,315 +0,0 @@ -import 'dart:async'; - -import 'package:flet/flet.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_web_plugins/url_strategy.dart'; -import 'package:msgpack_dart/msgpack_dart.dart' as msgpack; -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:path/path.dart' as path; -import 'package:path_provider/path_provider.dart' as path_provider; -import 'package:serious_python/bridge.dart'; -import 'package:serious_python/serious_python.dart'; - -const bool isProduction = bool.fromEnvironment('dart.vm.product'); - -const assetPath = "app/app.zip"; -const pythonModuleName = "main"; -final hideLoadingPage = - bool.tryParse("{{ cookiecutter.hide_loading_animation }}".toLowerCase()) ?? - true; -const errorExitCode = 100; - -/// The Python script is intentionally smaller than in `flet_example`. No -/// stdout-callback socket, no flet.sock — Python startup is just `runpy` -/// on the user module, and stdout/stderr stay attached to whatever the -/// embedded interpreter inherits. The dart_bridge transport in Flet 0.85+ -/// handles IPC directly. -const pythonScript = """ -import logging, os, runpy, sys, traceback - -# Redirect stdout/stderr to a file under FLET_APP_TEMP so we can inspect what -# Python is doing without a separate stdout-callback socket. Temporary — once -# the FFI transport is stable a more proper logging story can land. -_log_path = os.path.join( - os.environ.get("FLET_APP_TEMP", "/tmp"), "flet_boot.log" -) -_log = open(_log_path, "w", buffering=1) -sys.stdout = _log -sys.stderr = _log -logging.basicConfig(stream=_log, level=logging.DEBUG) -print(f"[boot] python {sys.version}", flush=True) -print(f"[boot] FLET_DART_BRIDGE_PORT={os.environ.get('FLET_DART_BRIDGE_PORT')}", flush=True) -print(f"[boot] FLET_PLATFORM={os.environ.get('FLET_PLATFORM')}", flush=True) - -try: - import certifi - os.environ["REQUESTS_CA_BUNDLE"] = certifi.where() - os.environ["SSL_CERT_FILE"] = certifi.where() - - if os.getenv("FLET_PLATFORM") == "android": - import ssl - - def create_default_context( - purpose=ssl.Purpose.SERVER_AUTH, *, - cafile=None, capath=None, cadata=None, - ): - return ssl.create_default_context( - purpose=purpose, - cafile=certifi.where(), - capath=capath, - cadata=cadata, - ) - - ssl._create_default_https_context = create_default_context -except ImportError as e: - print(f"[boot] certifi import failed: {e}", flush=True) - -print("[boot] about to runpy.run_module", flush=True) -try: - runpy.run_module("{module_name}", run_name="__main__") - print("[boot] runpy.run_module returned", flush=True) -except SystemExit as e: - print(f"[boot] SystemExit: {e.code}", flush=True) - raise -except Exception: - print("[boot] runpy.run_module raised:", flush=True) - traceback.print_exc() - sys.exit($errorExitCode) -"""; - -// global vars -String assetsDir = ""; -String appDir = ""; -late PythonBridge _bridge; -Map environmentVariables = {}; - -void main() async { - if (isProduction) { - // ignore: avoid_returning_null_for_void - debugPrint = (String? message, {int? wrapWidth}) => null; - } - - runApp(FutureBuilder( - future: prepareApp(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasData) { - return FletApp( - pageUrl: "dartbridge://${_bridge.port}", - assetsDir: assetsDir, - channelBuilder: ({required onMessage, required onDisconnect}) => - _DartBridgeBackendChannel(_bridge, - onMessage: onMessage, onDisconnect: onDisconnect), - ); - } else if (snapshot.hasError) { - return MaterialApp( - home: ErrorScreen( - title: "Error starting app", - text: snapshot.error.toString())); - } else { - return const MaterialApp(home: BlankScreen()); - } - })); -} - -Future prepareApp() async { - if (kIsWeb) { - var routeUrlStrategy = getFletRouteUrlStrategy(); - if (routeUrlStrategy == "path") { - usePathUrlStrategy(); - } - return ""; - } - - await setupDesktop(); - - // Extract app from asset. - appDir = await extractAssetZip(assetPath, checkHash: true); - Directory.current = appDir; - assetsDir = path.join(appDir, "assets"); - - WidgetsFlutterBinding.ensureInitialized(); - var appTempPath = (await path_provider.getApplicationCacheDirectory()).path; - var appDataPath = - (await path_provider.getApplicationDocumentsDirectory()).path; - - if (defaultTargetPlatform != TargetPlatform.iOS && - defaultTargetPlatform != TargetPlatform.android) { - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - appDataPath = path.join(appDataPath, "flet", packageInfo.packageName); - if (!await Directory(appDataPath).exists()) { - await Directory(appDataPath).create(recursive: true); - } - } - - // Create the PythonBridge before we hand its port to Python. It outlives - // the FletApp widget; the embedded interpreter only stops when the Flutter - // app exits. - _bridge = PythonBridge(); - - environmentVariables.addAll({ - "FLET_APP_DATA": appDataPath, - "FLET_APP_TEMP": appTempPath, - "FLET_PLATFORM": defaultTargetPlatform.name.toLowerCase(), - // Python reads this env var in flet.app.run_async() and starts the - // dart_bridge transport (added in flet's dart-bridge branch) bound to - // the same port. - "FLET_DART_BRIDGE_PORT": "${_bridge.port}", - }); - - // Fire-and-forget: Python lives for the duration of the app. SeriousPython - // dispatches it on a worker thread (sync=false default), so this returns - // immediately after spawning. - var script = pythonScript.replaceAll('{module_name}', pythonModuleName); - unawaited(SeriousPython.runProgram( - path.join(appDir, "$pythonModuleName.pyc"), - script: script, - environmentVariables: environmentVariables, - )); - - return ""; -} - -/// `FletBackendChannel` implementation backed by a [PythonBridge]. Bytes -/// flow Dart↔Python entirely in-process; no Unix socket, no kernel context -/// switch. The wire format is the same MsgPack-framed protocol the existing -/// socket-based `FletSocketBackendChannel` speaks. -class _DartBridgeBackendChannel implements FletBackendChannel { - _DartBridgeBackendChannel(this._bridge, - {required FletBackendChannelOnMessageCallback onMessage, - required FletBackendChannelOnDisconnectCallback onDisconnect}) - : _onMessage = onMessage, - _onDisconnect = onDisconnect, - _deserializer = - StreamingMsgpackDeserializer(extDecoder: FletMsgpackDecoder()); - - final PythonBridge _bridge; - final FletBackendChannelOnMessageCallback _onMessage; - final FletBackendChannelOnDisconnectCallback _onDisconnect; - final StreamingMsgpackDeserializer _deserializer; - StreamSubscription? _subscription; - - @override - Future connect() async { - _subscription = _bridge.messages.listen( - _onBytes, - onError: (error, stack) { - debugPrint("PythonBridge stream error: $error"); - _onDisconnect(); - }, - onDone: () { - debugPrint("PythonBridge stream closed."); - _onDisconnect(); - }, - cancelOnError: false, - ); - } - - void _onBytes(Uint8List bytes) { - _deserializer.addChunk(bytes); - final frames = _deserializer.decodeMessages(); - for (final frame in frames) { - _onMessage(Message.fromList(frame)); - } - } - - @override - void send(Message message) { - final encoded = Uint8List.fromList( - msgpack.serialize(message.toList(), extEncoder: FletMsgpackEncoder())); - // Retry loop covers the brief startup window where Python hasn't yet - // called dart_bridge.set_enqueue_handler_func — bridge.send returns - // false in that case. Once the handler is registered (Flet's app.py - // dart_bridge server start() does it before run_module dispatch), - // bridge.send returns true synchronously. - if (_bridge.send(encoded)) return; - _retrySend(encoded); - } - - void _retrySend(Uint8List encoded) { - const interval = Duration(milliseconds: 50); - const deadline = Duration(seconds: 30); - final start = DateTime.now(); - Timer.periodic(interval, (timer) { - if (_bridge.send(encoded)) { - timer.cancel(); - } else if (DateTime.now().difference(start) > deadline) { - timer.cancel(); - debugPrint("PythonBridge send timed out: Python handler never registered."); - } - }); - } - - @override - bool get isLocalConnection => true; - - @override - int get defaultReconnectIntervalMs => 0; - - @override - void disconnect() { - _subscription?.cancel(); - _subscription = null; - } -} - -class ErrorScreen extends StatelessWidget { - final String title; - final String text; - - const ErrorScreen({super.key, required this.title, required this.text}); - - @override - Widget build(BuildContext context) { - return Scaffold( - body: SafeArea( - child: Container( - padding: const EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - title, - style: Theme.of(context).textTheme.titleMedium, - ), - TextButton.icon( - onPressed: () { - Clipboard.setData(ClipboardData(text: text)); - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('Copied to clipboard')), - ); - }, - icon: const Icon( - Icons.copy, - size: 16, - ), - label: const Text("Copy"), - ) - ], - ), - Expanded( - child: SingleChildScrollView( - child: SelectableText(text, - style: Theme.of(context).textTheme.bodySmall), - )) - ], - ), - )), - ); - } -} - -class BlankScreen extends StatelessWidget { - const BlankScreen({super.key}); - - @override - Widget build(BuildContext context) { - return const Scaffold( - body: SizedBox.shrink(), - ); - } -} diff --git a/src/serious_python/example/flet_example/linux/.gitignore b/src/serious_python/example/flet_example/linux/.gitignore deleted file mode 100644 index d3896c98..00000000 --- a/src/serious_python/example/flet_example/linux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -flutter/ephemeral diff --git a/src/serious_python/example/flet_example/linux/CMakeLists.txt b/src/serious_python/example/flet_example/linux/CMakeLists.txt deleted file mode 100644 index d17d15d3..00000000 --- a/src/serious_python/example/flet_example/linux/CMakeLists.txt +++ /dev/null @@ -1,128 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "flet_example") -# The unique GTK application identifier for this application. See: -# https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.flet_example") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(SET CMP0063 NEW) - -# Load bundled libraries from the lib/ directory relative to the binary. -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Root filesystem for cross-building. -if(FLUTTER_TARGET_PLATFORM_SYSROOT) - set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -# Define build configuration options. -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") -endif() - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_14) - target_compile_options(${TARGET} PRIVATE -Wall -Werror) - target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") - target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) - -# Only the install-generated bundle's copy of the executable will launch -# correctly, since the resources must in the right relative locations. To avoid -# people trying to run the unbundled copy, put it in a subdirectory instead of -# the default top-level location. -set_target_properties(${BINARY_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" -) - - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# By default, "installing" just makes a relocatable bundle in the build -# directory. -set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -# Start with a clean build bundle directory every time. -install(CODE " - file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") - " COMPONENT Runtime) - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) - install(FILES "${bundled_library}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endforeach(bundled_library) - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() diff --git a/src/serious_python/example/flet_example/linux/flutter/CMakeLists.txt b/src/serious_python/example/flet_example/linux/flutter/CMakeLists.txt deleted file mode 100644 index d5bd0164..00000000 --- a/src/serious_python/example/flet_example/linux/flutter/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.10) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. - -# Serves the same purpose as list(TRANSFORM ... PREPEND ...), -# which isn't available in 3.10. -function(list_prepend LIST_NAME PREFIX) - set(NEW_LIST "") - foreach(element ${${LIST_NAME}}) - list(APPEND NEW_LIST "${PREFIX}${element}") - endforeach(element) - set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) -endfunction() - -# === Flutter Library === -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) - -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "fl_basic_message_channel.h" - "fl_binary_codec.h" - "fl_binary_messenger.h" - "fl_dart_project.h" - "fl_engine.h" - "fl_json_message_codec.h" - "fl_json_method_codec.h" - "fl_message_codec.h" - "fl_method_call.h" - "fl_method_channel.h" - "fl_method_codec.h" - "fl_method_response.h" - "fl_plugin_registrar.h" - "fl_plugin_registry.h" - "fl_standard_message_codec.h" - "fl_standard_method_codec.h" - "fl_string_codec.h" - "fl_value.h" - "fl_view.h" - "flutter_linux.h" -) -list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") -target_link_libraries(flutter INTERFACE - PkgConfig::GTK - PkgConfig::GLIB - PkgConfig::GIO -) -add_dependencies(flutter flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/_phony_ - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} -) diff --git a/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc b/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 142e738c..00000000 --- a/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,35 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) pasteboard_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin"); - pasteboard_plugin_register_with_registrar(pasteboard_registrar); - g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); - screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); - g_autoptr(FlPluginRegistrar) serious_python_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "SeriousPythonLinuxPlugin"); - serious_python_linux_plugin_register_with_registrar(serious_python_linux_registrar); - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); - g_autoptr(FlPluginRegistrar) window_manager_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin"); - window_manager_plugin_register_with_registrar(window_manager_registrar); - g_autoptr(FlPluginRegistrar) window_to_front_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "WindowToFrontPlugin"); - window_to_front_plugin_register_with_registrar(window_to_front_registrar); -} diff --git a/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.h b/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.h deleted file mode 100644 index e0f0a47b..00000000 --- a/src/serious_python/example/flet_example/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake b/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake deleted file mode 100644 index 7d9bc28c..00000000 --- a/src/serious_python/example/flet_example/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,30 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - pasteboard - screen_retriever_linux - serious_python_linux - url_launcher_linux - window_manager - window_to_front -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST - jni -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/src/serious_python/example/flet_example/linux/runner/CMakeLists.txt b/src/serious_python/example/flet_example/linux/runner/CMakeLists.txt deleted file mode 100644 index e97dabc7..00000000 --- a/src/serious_python/example/flet_example/linux/runner/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the application ID. -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) - -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/src/serious_python/example/flet_example/linux/runner/main.cc b/src/serious_python/example/flet_example/linux/runner/main.cc deleted file mode 100644 index e7c5c543..00000000 --- a/src/serious_python/example/flet_example/linux/runner/main.cc +++ /dev/null @@ -1,6 +0,0 @@ -#include "my_application.h" - -int main(int argc, char** argv) { - g_autoptr(MyApplication) app = my_application_new(); - return g_application_run(G_APPLICATION(app), argc, argv); -} diff --git a/src/serious_python/example/flet_example/linux/runner/my_application.cc b/src/serious_python/example/flet_example/linux/runner/my_application.cc deleted file mode 100644 index 7c4258d0..00000000 --- a/src/serious_python/example/flet_example/linux/runner/my_application.cc +++ /dev/null @@ -1,148 +0,0 @@ -#include "my_application.h" - -#include -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#include "flutter/generated_plugin_registrant.h" - -struct _MyApplication { - GtkApplication parent_instance; - char** dart_entrypoint_arguments; -}; - -G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) - -// Called when first Flutter frame received. -static void first_frame_cb(MyApplication* self, FlView* view) { - gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); -} - -// Implements GApplication::activate. -static void my_application_activate(GApplication* application) { - MyApplication* self = MY_APPLICATION(application); - GtkWindow* window = - GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - - // Use a header bar when running in GNOME as this is the common style used - // by applications and is the setup most users will be using (e.g. Ubuntu - // desktop). - // If running on X and not using GNOME then just use a traditional title bar - // in case the window manager does more exotic layout, e.g. tiling. - // If running on Wayland assume the header bar will work (may need changing - // if future cases occur). - gboolean use_header_bar = TRUE; -#ifdef GDK_WINDOWING_X11 - GdkScreen* screen = gtk_window_get_screen(window); - if (GDK_IS_X11_SCREEN(screen)) { - const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { - use_header_bar = FALSE; - } - } -#endif - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "flet_example"); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, "flet_example"); - } - - gtk_window_set_default_size(window, 1280, 720); - - g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments( - project, self->dart_entrypoint_arguments); - - FlView* view = fl_view_new(project); - GdkRGBA background_color; - // Background defaults to black, override it here if necessary, e.g. #00000000 - // for transparent. - gdk_rgba_parse(&background_color, "#000000"); - fl_view_set_background_color(view, &background_color); - gtk_widget_show(GTK_WIDGET(view)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); - - // Show the window when Flutter renders. - // Requires the view to be realized so we can start rendering. - g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), - self); - gtk_widget_realize(GTK_WIDGET(view)); - - fl_register_plugins(FL_PLUGIN_REGISTRY(view)); - - gtk_widget_grab_focus(GTK_WIDGET(view)); -} - -// Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, - gchar*** arguments, - int* exit_status) { - MyApplication* self = MY_APPLICATION(application); - // Strip out the first argument as it is the binary name. - self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); - - g_autoptr(GError) error = nullptr; - if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; - } - - g_application_activate(application); - *exit_status = 0; - - return TRUE; -} - -// Implements GApplication::startup. -static void my_application_startup(GApplication* application) { - // MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application startup. - - G_APPLICATION_CLASS(my_application_parent_class)->startup(application); -} - -// Implements GApplication::shutdown. -static void my_application_shutdown(GApplication* application) { - // MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application shutdown. - - G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); -} - -// Implements GObject::dispose. -static void my_application_dispose(GObject* object) { - MyApplication* self = MY_APPLICATION(object); - g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); - G_OBJECT_CLASS(my_application_parent_class)->dispose(object); -} - -static void my_application_class_init(MyApplicationClass* klass) { - G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = - my_application_local_command_line; - G_APPLICATION_CLASS(klass)->startup = my_application_startup; - G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; - G_OBJECT_CLASS(klass)->dispose = my_application_dispose; -} - -static void my_application_init(MyApplication* self) {} - -MyApplication* my_application_new() { - // Set the program name to the application ID, which helps various systems - // like GTK and desktop environments map this running application to its - // corresponding .desktop file. This ensures better integration by allowing - // the application to be recognized beyond its binary name. - g_set_prgname(APPLICATION_ID); - - return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, "flags", - G_APPLICATION_NON_UNIQUE, nullptr)); -} diff --git a/src/serious_python/example/flet_example/linux/runner/my_application.h b/src/serious_python/example/flet_example/linux/runner/my_application.h deleted file mode 100644 index db16367a..00000000 --- a/src/serious_python/example/flet_example/linux/runner/my_application.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef FLUTTER_MY_APPLICATION_H_ -#define FLUTTER_MY_APPLICATION_H_ - -#include - -G_DECLARE_FINAL_TYPE(MyApplication, - my_application, - MY, - APPLICATION, - GtkApplication) - -/** - * my_application_new: - * - * Creates a new Flutter-based application. - * - * Returns: a new #MyApplication. - */ -MyApplication* my_application_new(); - -#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/src/serious_python/example/flet_example/macos/.gitignore b/src/serious_python/example/flet_example/macos/.gitignore deleted file mode 100644 index 746adbb6..00000000 --- a/src/serious_python/example/flet_example/macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ diff --git a/src/serious_python/example/flet_example/macos/Flutter/Flutter-Debug.xcconfig b/src/serious_python/example/flet_example/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100644 index 4b81f9b2..00000000 --- a/src/serious_python/example/flet_example/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/src/serious_python/example/flet_example/macos/Flutter/Flutter-Release.xcconfig b/src/serious_python/example/flet_example/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100644 index 5caa9d15..00000000 --- a/src/serious_python/example/flet_example/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift b/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index 6d5caa62..00000000 --- a/src/serious_python/example/flet_example/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import battery_plus -import connectivity_plus -import device_info_plus -import file_picker -import package_info_plus -import pasteboard -import screen_brightness_macos -import screen_retriever_macos -import serious_python_darwin -import share_plus -import shared_preferences_foundation -import url_launcher_macos -import wakelock_plus -import window_manager -import window_to_front - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - BatteryPlusMacosPlugin.register(with: registry.registrar(forPlugin: "BatteryPlusMacosPlugin")) - ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) - DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) - FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) - FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) - ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin")) - ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) - SeriousPythonPlugin.register(with: registry.registrar(forPlugin: "SeriousPythonPlugin")) - SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) - UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) - WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin")) - WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) - WindowToFrontPlugin.register(with: registry.registrar(forPlugin: "WindowToFrontPlugin")) -} diff --git a/src/serious_python/example/flet_example/macos/Podfile b/src/serious_python/example/flet_example/macos/Podfile deleted file mode 100644 index b52666a1..00000000 --- a/src/serious_python/example/flet_example/macos/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -platform :osx, '10.15' - -# 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 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 5f5d96ea..00000000 --- a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,705 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC10EC2044A3C60003C045; - remoteInfo = Runner; - }; - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* flet_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flet_example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 331C80D2294CF70F00263BE5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C80D6294CF71000263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C80D7294CF71000263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 331C80D6294CF71000263BE5 /* RunnerTests */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* flet_example.app */, - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C80D4294CF70F00263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C80D1294CF70F00263BE5 /* Sources */, - 331C80D2294CF70F00263BE5 /* Frameworks */, - 331C80D3294CF70F00263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C80DA294CF71000263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* flet_example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C80D4294CF70F00263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 33CC10EC2044A3C60003C045; - }; - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 331C80D4294CF70F00263BE5 /* RunnerTests */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C80D3294CF70F00263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C80D1294CF70F00263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC10EC2044A3C60003C045 /* Runner */; - targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; - }; - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 331C80DB294CF71000263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flet_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flet_example"; - }; - name = Debug; - }; - 331C80DC294CF71000263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flet_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flet_example"; - }; - name = Release; - }; - 331C80DD294CF71000263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flet_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flet_example"; - }; - name = Profile; - }; - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C80DB294CF71000263BE5 /* Debug */, - 331C80DC294CF71000263BE5 /* Release */, - 331C80DD294CF71000263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/flet_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 410c6419..00000000 --- a/src/serious_python/example/flet_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata b/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16..00000000 --- a/src/serious_python/example/flet_example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/serious_python/example/flet_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/serious_python/example/flet_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/src/serious_python/example/flet_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/src/serious_python/example/flet_example/macos/Runner/AppDelegate.swift b/src/serious_python/example/flet_example/macos/Runner/AppDelegate.swift deleted file mode 100644 index b3c17614..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Cocoa -import FlutterMacOS - -@main -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } - - override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { - return true - } -} diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a2ec33f1..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100644 index 82b6f9d9..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100644 index 13b35eba..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100644 index 0a3f5fa4..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100644 index bdb57226..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100644 index f083318e..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100644 index 326c0e72..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100644 index 2f1632cf..00000000 Binary files a/src/serious_python/example/flet_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/macos/Runner/Base.lproj/MainMenu.xib b/src/serious_python/example/flet_example/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100644 index 80e867a4..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig b/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100644 index 3f116d66..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = flet_example - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.fletExample - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved. diff --git a/src/serious_python/example/flet_example/macos/Runner/Configs/Debug.xcconfig b/src/serious_python/example/flet_example/macos/Runner/Configs/Debug.xcconfig deleted file mode 100644 index 36b0fd94..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/src/serious_python/example/flet_example/macos/Runner/Configs/Release.xcconfig b/src/serious_python/example/flet_example/macos/Runner/Configs/Release.xcconfig deleted file mode 100644 index dff4f495..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/src/serious_python/example/flet_example/macos/Runner/Configs/Warnings.xcconfig b/src/serious_python/example/flet_example/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100644 index 42bcbf47..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/src/serious_python/example/flet_example/macos/Runner/DebugProfile.entitlements b/src/serious_python/example/flet_example/macos/Runner/DebugProfile.entitlements deleted file mode 100644 index 9f56413f..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,12 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - diff --git a/src/serious_python/example/flet_example/macos/Runner/Info.plist b/src/serious_python/example/flet_example/macos/Runner/Info.plist deleted file mode 100644 index 4789daa6..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/src/serious_python/example/flet_example/macos/Runner/MainFlutterWindow.swift b/src/serious_python/example/flet_example/macos/Runner/MainFlutterWindow.swift deleted file mode 100644 index 3cc05eb2..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/src/serious_python/example/flet_example/macos/Runner/Release.entitlements b/src/serious_python/example/flet_example/macos/Runner/Release.entitlements deleted file mode 100644 index e89b7f32..00000000 --- a/src/serious_python/example/flet_example/macos/Runner/Release.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff --git a/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift b/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift deleted file mode 100644 index 61f3bd1f..00000000 --- a/src/serious_python/example/flet_example/macos/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Cocoa -import FlutterMacOS -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/src/serious_python/example/flet_example/pubspec.lock b/src/serious_python/example/flet_example/pubspec.lock deleted file mode 100644 index ec64d540..00000000 --- a/src/serious_python/example/flet_example/pubspec.lock +++ /dev/null @@ -1,1201 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - archive: - dependency: transitive - description: - name: archive - sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff - url: "https://pub.dev" - source: hosted - version: "4.0.9" - args: - dependency: transitive - description: - name: args - sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 - url: "https://pub.dev" - source: hosted - version: "2.7.0" - async: - dependency: transitive - description: - name: async - sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 - url: "https://pub.dev" - source: hosted - version: "2.13.1" - battery_plus: - dependency: transitive - description: - name: battery_plus - sha256: ad16fcb55b7384be6b4bbc763d5e2031ac7ea62b2d9b6b661490c7b9741155bf - url: "https://pub.dev" - source: hosted - version: "7.0.0" - battery_plus_platform_interface: - dependency: transitive - description: - name: battery_plus_platform_interface - sha256: e8342c0f32de4b1dfd0223114b6785e48e579bfc398da9471c9179b907fa4910 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - characters: - dependency: transitive - description: - name: characters - sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b - url: "https://pub.dev" - source: hosted - version: "1.4.1" - clock: - dependency: transitive - description: - name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://pub.dev" - source: hosted - version: "1.1.2" - code_assets: - dependency: transitive - description: - name: code_assets - sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - collection: - dependency: transitive - description: - name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://pub.dev" - source: hosted - version: "1.19.1" - connectivity_plus: - dependency: transitive - description: - name: connectivity_plus - sha256: "62ffa266d9a23b79fb3fcbc206afc00bb979417ba57b1324c546b5aab95ba057" - url: "https://pub.dev" - source: hosted - version: "7.1.1" - connectivity_plus_platform_interface: - dependency: transitive - description: - name: connectivity_plus_platform_interface - sha256: "3c09627c536d22fd24691a905cdd8b14520de69da52c7a97499c8be5284a32ed" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "28bb3ae56f117b5aec029d702a90f57d285cd975c3c5c281eaca38dbc47c5937" - url: "https://pub.dev" - source: hosted - version: "0.3.5+2" - crypto: - dependency: transitive - description: - name: crypto - sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf - url: "https://pub.dev" - source: hosted - version: "3.0.7" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" - url: "https://pub.dev" - source: hosted - version: "1.0.9" - dbus: - dependency: transitive - description: - name: dbus - sha256: d0c98dcd4f5169878b6cf8f6e0a52403a9dff371a3e2f019697accbf6f44a270 - url: "https://pub.dev" - source: hosted - version: "0.7.12" - device_info_plus: - dependency: transitive - description: - name: device_info_plus - sha256: b4fed1b2835da9d670d7bed7db79ae2a94b0f5ad6312268158a9b5479abbacdd - url: "https://pub.dev" - source: hosted - version: "12.4.0" - device_info_plus_platform_interface: - dependency: transitive - description: - name: device_info_plus_platform_interface - sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f - url: "https://pub.dev" - source: hosted - version: "7.0.3" - equatable: - dependency: transitive - description: - name: equatable - sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" - url: "https://pub.dev" - source: hosted - version: "2.0.8" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" - url: "https://pub.dev" - source: hosted - version: "1.3.3" - ffi: - dependency: transitive - description: - name: ffi - sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - file: - dependency: transitive - description: - name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.dev" - source: hosted - version: "7.0.1" - file_picker: - dependency: transitive - description: - name: file_picker - sha256: "57d9a1dd5063f85fa3107fb42d1faffda52fdc948cefd5fe5ea85267a5fc7343" - url: "https://pub.dev" - source: hosted - version: "10.3.10" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.dev" - source: hosted - version: "1.1.1" - flet: - dependency: "direct main" - description: - path: "packages/flet" - ref: dart-bridge - resolved-ref: f738809348606dc3b5071ebabf540d1f034d2d75 - url: "https://github.com/flet-dev/flet.git" - source: git - version: "0.86.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_driver: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_highlight: - dependency: transitive - description: - name: flutter_highlight - sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" - source: hosted - version: "2.0.3" - flutter_localizations: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_markdown_plus: - dependency: transitive - description: - name: flutter_markdown_plus - sha256: "039177906850278e8fb1cd364115ee0a46281135932fa8ecea8455522166d2de" - url: "https://pub.dev" - source: hosted - version: "1.0.7" - flutter_markdown_plus_latex: - dependency: transitive - description: - name: flutter_markdown_plus_latex - sha256: "2e7698b291f0657ca445efab730bb25a8c5851037e882cb7bf47d16a5c218de7" - url: "https://pub.dev" - source: hosted - version: "1.0.5" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - sha256: "6d5f2f1aa57ae539ffb0a04bb39d2da67af74601d685a161aff7ce5bda5fa407" - url: "https://pub.dev" - source: hosted - version: "0.7.4" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - sha256: "3854fe5e3bff0b113c658f260b90c95dea17c92db0f2addeac2e343dd9969785" - url: "https://pub.dev" - source: hosted - version: "2.0.35" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f" - url: "https://pub.dev" - source: hosted - version: "2.3.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - fuchsia_remote_debug_protocol: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de - url: "https://pub.dev" - source: hosted - version: "2.1.3" - highlight: - dependency: transitive - description: - name: highlight - sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - hooks: - dependency: transitive - description: - name: hooks - sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - http: - dependency: transitive - description: - name: http - sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" - url: "https://pub.dev" - source: hosted - version: "1.6.0" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.dev" - source: hosted - version: "4.1.2" - integration_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - intl: - dependency: transitive - description: - name: intl - sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" - url: "https://pub.dev" - source: hosted - version: "0.20.2" - jni: - dependency: transitive - description: - name: jni - sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f - url: "https://pub.dev" - source: hosted - version: "1.0.0" - jni_flutter: - dependency: transitive - description: - name: jni_flutter - sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80" - url: "https://pub.dev" - source: hosted - version: "4.12.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" - url: "https://pub.dev" - source: hosted - version: "11.0.2" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" - url: "https://pub.dev" - source: hosted - version: "3.0.10" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - logging: - dependency: transitive - description: - name: logging - sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - markdown: - dependency: transitive - description: - name: markdown - sha256: ee85086ad7698b42522c6ad42fe195f1b9898e4d974a1af4576c1a3a176cada9 - url: "https://pub.dev" - source: hosted - version: "7.3.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 - url: "https://pub.dev" - source: hosted - version: "0.12.19" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" - url: "https://pub.dev" - source: hosted - version: "0.13.0" - meta: - dependency: transitive - description: - name: meta - sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" - url: "https://pub.dev" - source: hosted - version: "1.18.0" - mime: - dependency: transitive - description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - msgpack_dart: - dependency: "direct main" - description: - name: msgpack_dart - sha256: c2d235ed01f364719b5296aecf43ac330f0d7bc865fa134d0d7910a40454dffb - url: "https://pub.dev" - source: hosted - version: "1.0.1" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - nm: - dependency: transitive - description: - name: nm - sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://pub.dev" - source: hosted - version: "0.5.0" - objective_c: - dependency: transitive - description: - name: objective_c - sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" - url: "https://pub.dev" - source: hosted - version: "9.4.1" - package_config: - dependency: transitive - description: - name: package_config - sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc - url: "https://pub.dev" - source: hosted - version: "2.2.0" - package_info_plus: - dependency: "direct main" - description: - name: package_info_plus - sha256: "468c26b4254ab01979fa5e4a98cb343ea3631b9acee6f21028997419a80e1a20" - url: "https://pub.dev" - source: hosted - version: "9.0.1" - package_info_plus_platform_interface: - dependency: transitive - description: - name: package_info_plus_platform_interface - sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - pasteboard: - dependency: transitive - description: - name: pasteboard - sha256: "9ff73ada33f79a59ff91f6c01881fd4ed0a0031cfc4ae2d86c0384471525fca1" - url: "https://pub.dev" - source: hosted - version: "0.4.0" - path: - dependency: "direct main" - description: - name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - path_provider: - dependency: "direct main" - description: - name: path_provider - sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" - url: "https://pub.dev" - source: hosted - version: "2.3.1" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" - url: "https://pub.dev" - source: hosted - version: "2.6.0" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.dev" - source: hosted - version: "2.3.0" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" - url: "https://pub.dev" - source: hosted - version: "6.1.0" - platform: - dependency: transitive - description: - name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.dev" - source: hosted - version: "3.1.6" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - posix: - dependency: transitive - description: - name: posix - sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" - url: "https://pub.dev" - source: hosted - version: "6.5.0" - process: - dependency: transitive - description: - name: process - sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 - url: "https://pub.dev" - source: hosted - version: "5.0.5" - provider: - dependency: transitive - description: - name: provider - sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" - url: "https://pub.dev" - source: hosted - version: "6.1.5+1" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - record_use: - dependency: transitive - description: - name: record_use - sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" - url: "https://pub.dev" - source: hosted - version: "0.6.0" - screen_brightness: - dependency: transitive - description: - name: screen_brightness - sha256: "7ea1c037422f007f022dcff3ee955bf8e61a474d5426b29be9290fd976c3e46b" - url: "https://pub.dev" - source: hosted - version: "2.1.9" - screen_brightness_android: - dependency: transitive - description: - name: screen_brightness_android - sha256: "0e4b0a07d5f730b91a8780d8436f3a92be8a8cc2066032ed88b93c8fa153fadf" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - screen_brightness_ios: - dependency: transitive - description: - name: screen_brightness_ios - sha256: "0792d8f98852558f831b4b75241c46047b884598b3f4d982b37dc2dd43e2b2e1" - url: "https://pub.dev" - source: hosted - version: "2.1.3" - screen_brightness_macos: - dependency: transitive - description: - name: screen_brightness_macos - sha256: "278712cf5288db57bd335968cbfb2ec5441028f1ee2fcbdc8d1582d8210a3442" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - screen_brightness_ohos: - dependency: transitive - description: - name: screen_brightness_ohos - sha256: "33f495741d5aa53104d3f5875dcb4b6a119f29ef595be17129ee03a5b78e76a9" - url: "https://pub.dev" - source: hosted - version: "2.1.3" - screen_brightness_platform_interface: - dependency: transitive - description: - name: screen_brightness_platform_interface - sha256: "59d50850d6735d677780fc7359c8e997d0ff6df91c8465161c9e617a7b0a11d8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - screen_brightness_windows: - dependency: transitive - description: - name: screen_brightness_windows - sha256: "121f9dd6d62585bfb4e468c2170804ce4f2a2303ae6b2efc3a065c94937505d7" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - screen_retriever: - dependency: transitive - description: - name: screen_retriever - sha256: "42cc3b402a0f67d2455a0d067553d0f13453f6a008d98eababf8b63958d506bd" - url: "https://pub.dev" - source: hosted - version: "0.2.1" - screen_retriever_linux: - dependency: transitive - description: - name: screen_retriever_linux - sha256: "2a476f1a5538065bc5badf376cfdc83d6ecf07d77eb2391b9c2bff5a76970048" - url: "https://pub.dev" - source: hosted - version: "0.2.1" - screen_retriever_macos: - dependency: transitive - description: - name: screen_retriever_macos - sha256: b5abb900fcb86614ff10b738b34e37b9e1d03b0447280668e2bc8a98bdc7bd59 - url: "https://pub.dev" - source: hosted - version: "0.2.1" - screen_retriever_platform_interface: - dependency: transitive - description: - name: screen_retriever_platform_interface - sha256: "3af22d926bedf20c2caa308eea376776451a3af125919ce072e56525fded8901" - url: "https://pub.dev" - source: hosted - version: "0.2.1" - screen_retriever_windows: - dependency: transitive - description: - name: screen_retriever_windows - sha256: c44b38a4c4bab34af259180a70a4eee1e29384e7b82e627c9faa68afcdab2e73 - url: "https://pub.dev" - source: hosted - version: "0.2.1" - screenshot: - dependency: transitive - description: - name: screenshot - sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - sensors_plus: - dependency: transitive - description: - name: sensors_plus - sha256: "56e8cd4260d9ed8e00ecd8da5d9fdc8a1b2ec12345a750dfa51ff83fcf12e3fa" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - sensors_plus_platform_interface: - dependency: transitive - description: - name: sensors_plus_platform_interface - sha256: "58815d2f5e46c0c41c40fb39375d3f127306f7742efe3b891c0b1c87e2b5cd5d" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - serious_python: - dependency: "direct main" - description: - path: "../.." - relative: true - source: path - version: "2.0.0" - serious_python_android: - dependency: transitive - description: - path: "../../../serious_python_android" - relative: true - source: path - version: "2.0.0" - serious_python_darwin: - dependency: transitive - description: - path: "../../../serious_python_darwin" - relative: true - source: path - version: "2.0.0" - serious_python_linux: - dependency: transitive - description: - path: "../../../serious_python_linux" - relative: true - source: path - version: "2.0.0" - serious_python_platform_interface: - dependency: transitive - description: - path: "../../../serious_python_platform_interface" - relative: true - source: path - version: "2.0.0" - serious_python_windows: - dependency: transitive - description: - path: "../../../serious_python_windows" - relative: true - source: path - version: "2.0.0" - share_plus: - dependency: transitive - description: - name: share_plus - sha256: "223873d106614442ea6f20db5a038685cc5b32a2fba81cdecaefbbae0523f7fa" - url: "https://pub.dev" - source: hosted - version: "12.0.2" - share_plus_platform_interface: - dependency: transitive - description: - name: share_plus_platform_interface - sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a" - url: "https://pub.dev" - source: hosted - version: "6.1.0" - shared_preferences: - dependency: transitive - description: - name: shared_preferences - sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf - url: "https://pub.dev" - source: hosted - version: "2.5.5" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: "93ae5884a9df5d3bb696825bceb3a17590754548b5d740eba51500afc8d088f5" - url: "https://pub.dev" - source: hosted - version: "2.4.26" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" - url: "https://pub.dev" - source: hosted - version: "2.5.6" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" - url: "https://pub.dev" - source: hosted - version: "2.4.2" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://pub.dev" - source: hosted - version: "2.4.3" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - shelf: - dependency: transitive - description: - name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 - url: "https://pub.dev" - source: hosted - version: "1.4.2" - shimmer: - dependency: transitive - description: - name: shimmer - sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - source_span: - dependency: transitive - description: - name: source_span - sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" - url: "https://pub.dev" - source: hosted - version: "1.10.2" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://pub.dev" - source: hosted - version: "1.12.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://pub.dev" - source: hosted - version: "1.4.1" - sync_http: - dependency: transitive - description: - name: sync_http - sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.dev" - source: hosted - version: "0.3.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://pub.dev" - source: hosted - version: "1.2.2" - test_api: - dependency: transitive - description: - name: test_api - sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" - url: "https://pub.dev" - source: hosted - version: "0.7.11" - toml: - dependency: transitive - description: - name: toml - sha256: "9968de24e45b632bf1a654fe1ac7b6fe5261c349243df83fd262397799c45a2d" - url: "https://pub.dev" - source: hosted - version: "0.15.0" - tuple: - dependency: transitive - description: - name: tuple - sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" - source: hosted - version: "2.0.2" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - upower: - dependency: transitive - description: - name: upower - sha256: cf042403154751180affa1d15614db7fa50234bc2373cd21c3db666c38543ebf - url: "https://pub.dev" - source: hosted - version: "0.7.0" - url_launcher: - dependency: transitive - description: - name: url_launcher - sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 - url: "https://pub.dev" - source: hosted - version: "6.3.2" - url_launcher_android: - dependency: transitive - description: - name: url_launcher_android - sha256: b413d49b73867ac08dd2f9890efd3cc11f2a0e577618d50843440a1fb3776c32 - url: "https://pub.dev" - source: hosted - version: "6.3.32" - url_launcher_ios: - dependency: transitive - description: - name: url_launcher_ios - sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0" - url: "https://pub.dev" - source: hosted - version: "6.4.1" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a - url: "https://pub.dev" - source: hosted - version: "3.2.2" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18" - url: "https://pub.dev" - source: hosted - version: "3.2.5" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34" - url: "https://pub.dev" - source: hosted - version: "2.4.3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" - url: "https://pub.dev" - source: hosted - version: "3.1.5" - uuid: - dependency: transitive - description: - name: uuid - sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" - url: "https://pub.dev" - source: hosted - version: "4.5.3" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "2306c03da2ba81724afeb589c351ebbc0aa7d86005925be8f8735856dbe5e42d" - url: "https://pub.dev" - source: hosted - version: "1.2.2" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" - url: "https://pub.dev" - source: hosted - version: "1.1.13" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "7ee12e6dffe0fc8e755179d6d91b3b34f5924223fc104d85572ef9180d73d172" - url: "https://pub.dev" - source: hosted - version: "1.2.5" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b - url: "https://pub.dev" - source: hosted - version: "2.2.0" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" - url: "https://pub.dev" - source: hosted - version: "15.2.0" - wakelock_plus: - dependency: transitive - description: - name: wakelock_plus - sha256: ddf3db70eaa10c37558ff817519b85d527dbd21034fd5d8e1c2e85f31588f1c1 - url: "https://pub.dev" - source: hosted - version: "1.5.2" - wakelock_plus_platform_interface: - dependency: transitive - description: - name: wakelock_plus_platform_interface - sha256: b13f99e992e7ae6a152e16c5559d3c07ff445b13330192662494e614ca3e7d7b - url: "https://pub.dev" - source: hosted - version: "1.5.1" - web: - dependency: transitive - description: - name: web - sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - web_socket: - dependency: transitive - description: - name: web_socket - sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 - url: "https://pub.dev" - source: hosted - version: "3.0.3" - webdriver: - dependency: transitive - description: - name: webdriver - sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - win32: - dependency: transitive - description: - name: win32 - sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e - url: "https://pub.dev" - source: hosted - version: "5.15.0" - win32_registry: - dependency: transitive - description: - name: win32_registry - sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - window_manager: - dependency: transitive - description: - name: window_manager - sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd" - url: "https://pub.dev" - source: hosted - version: "0.5.1" - window_to_front: - dependency: transitive - description: - name: window_to_front - sha256: "14fad8984db4415e2eeb30b04bb77140b180e260d6cb66b26de126a8657a9241" - url: "https://pub.dev" - source: hosted - version: "0.0.4" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - xml: - dependency: transitive - description: - name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.dev" - source: hosted - version: "6.5.0" - yaml: - dependency: transitive - description: - name: yaml - sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce - url: "https://pub.dev" - source: hosted - version: "3.1.3" -sdks: - dart: ">=3.12.0 <4.0.0" - flutter: ">=3.44.0" diff --git a/src/serious_python/example/flet_example/pubspec.yaml b/src/serious_python/example/flet_example/pubspec.yaml deleted file mode 100644 index d17c3e2c..00000000 --- a/src/serious_python/example/flet_example/pubspec.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: flet_example -description: Flet counter app running on the in-process dart_bridge FFI transport. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 - -environment: - sdk: ">=3.0.3 <4.0.0" - flutter: ">=3.7.0" - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - flutter_web_plugins: - sdk: flutter - - serious_python: - path: ../../ - - flet: - git: - url: https://github.com/flet-dev/flet.git - ref: dart-bridge - path: packages/flet - - path: ^1.8.3 - path_provider: ^2.1.4 - package_info_plus: ^9.0.0 - # msgpack_dart is the wire format Flet uses. _DartBridgeBackendChannel - # (in lib/main.dart) encodes outbound frames before handing them to - # PythonBridge.send. - msgpack_dart: ^1.0.1 - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - -dev_dependencies: - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^2.0.0 - integration_test: - sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - uses-material-design: true - - assets: - - app/app.zip - - app/app.zip.hash \ No newline at end of file diff --git a/src/serious_python/example/flet_example/test/widget_test.dart b/src/serious_python/example/flet_example/test/widget_test.dart deleted file mode 100644 index 49c1e76c..00000000 --- a/src/serious_python/example/flet_example/test/widget_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -void main() { - // todo -} diff --git a/src/serious_python/example/flet_example/test_driver/integration_test.dart b/src/serious_python/example/flet_example/test_driver/integration_test.dart deleted file mode 100644 index b38629cc..00000000 --- a/src/serious_python/example/flet_example/test_driver/integration_test.dart +++ /dev/null @@ -1,3 +0,0 @@ -import 'package:integration_test/integration_test_driver.dart'; - -Future main() => integrationDriver(); diff --git a/src/serious_python/example/flet_example/web/favicon.png b/src/serious_python/example/flet_example/web/favicon.png deleted file mode 100644 index 8aaa46ac..00000000 Binary files a/src/serious_python/example/flet_example/web/favicon.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/web/icons/Icon-192.png b/src/serious_python/example/flet_example/web/icons/Icon-192.png deleted file mode 100644 index b749bfef..00000000 Binary files a/src/serious_python/example/flet_example/web/icons/Icon-192.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/web/icons/Icon-512.png b/src/serious_python/example/flet_example/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48d..00000000 Binary files a/src/serious_python/example/flet_example/web/icons/Icon-512.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/web/icons/Icon-maskable-192.png b/src/serious_python/example/flet_example/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d76..00000000 Binary files a/src/serious_python/example/flet_example/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/web/icons/Icon-maskable-512.png b/src/serious_python/example/flet_example/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c5669..00000000 Binary files a/src/serious_python/example/flet_example/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/src/serious_python/example/flet_example/web/index.html b/src/serious_python/example/flet_example/web/index.html deleted file mode 100644 index d1962549..00000000 --- a/src/serious_python/example/flet_example/web/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - flet_example - - - - - - - diff --git a/src/serious_python/example/flet_example/web/manifest.json b/src/serious_python/example/flet_example/web/manifest.json deleted file mode 100644 index 58b0e920..00000000 --- a/src/serious_python/example/flet_example/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "flet_example", - "short_name": "flet_example", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/src/serious_python/example/flet_example/windows/.gitignore b/src/serious_python/example/flet_example/windows/.gitignore deleted file mode 100644 index d492d0d9..00000000 --- a/src/serious_python/example/flet_example/windows/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -flutter/ephemeral/ - -# Visual Studio user-specific files. -*.suo -*.user -*.userosscache -*.sln.docstates - -# Visual Studio build-related files. -x64/ -x86/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ diff --git a/src/serious_python/example/flet_example/windows/CMakeLists.txt b/src/serious_python/example/flet_example/windows/CMakeLists.txt deleted file mode 100644 index 6bb428e1..00000000 --- a/src/serious_python/example/flet_example/windows/CMakeLists.txt +++ /dev/null @@ -1,108 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.14) -project(flet_example LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "flet_example") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(VERSION 3.14...3.25) - -# Define build configuration option. -get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" - CACHE STRING "" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") - endif() -endif() -# Define settings for the Profile build mode. -set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") -set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") - -# Use Unicode for all projects. -add_definitions(-DUNICODE -D_UNICODE) - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) - target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") - target_compile_options(${TARGET} PRIVATE /EHsc) - target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") - target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# Support files are copied into place next to the executable, so that it can -# run in place. This is done instead of making a separate bundle (as on Linux) -# so that building and running from within Visual Studio will work. -set(BUILD_BUNDLE_DIR "$") -# Make the "install" step default, as it's required to run. -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - CONFIGURATIONS Profile;Release - COMPONENT Runtime) diff --git a/src/serious_python/example/flet_example/windows/flutter/CMakeLists.txt b/src/serious_python/example/flet_example/windows/flutter/CMakeLists.txt deleted file mode 100644 index 903f4899..00000000 --- a/src/serious_python/example/flet_example/windows/flutter/CMakeLists.txt +++ /dev/null @@ -1,109 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.14) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. -set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") - -# Set fallback configurations for older versions of the flutter tool. -if (NOT DEFINED FLUTTER_TARGET_PLATFORM) - set(FLUTTER_TARGET_PLATFORM "windows-x64") -endif() - -# === Flutter Library === -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "flutter_export.h" - "flutter_windows.h" - "flutter_messenger.h" - "flutter_plugin_registrar.h" - "flutter_texture_registrar.h" -) -list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") -add_dependencies(flutter flutter_assemble) - -# === Wrapper === -list(APPEND CPP_WRAPPER_SOURCES_CORE - "core_implementations.cc" - "standard_codec.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_PLUGIN - "plugin_registrar.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_APP - "flutter_engine.cc" - "flutter_view_controller.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") - -# Wrapper sources needed for a plugin. -add_library(flutter_wrapper_plugin STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} -) -apply_standard_settings(flutter_wrapper_plugin) -set_target_properties(flutter_wrapper_plugin PROPERTIES - POSITION_INDEPENDENT_CODE ON) -set_target_properties(flutter_wrapper_plugin PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) -target_include_directories(flutter_wrapper_plugin PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_plugin flutter_assemble) - -# Wrapper sources needed for the runner. -add_library(flutter_wrapper_app STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_APP} -) -apply_standard_settings(flutter_wrapper_app) -target_link_libraries(flutter_wrapper_app PUBLIC flutter) -target_include_directories(flutter_wrapper_app PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_app flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") -set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} - ${PHONY_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - ${FLUTTER_TARGET_PLATFORM} $ - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} -) diff --git a/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc b/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 5280993c..00000000 --- a/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,41 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - BatteryPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("BatteryPlusWindowsPlugin")); - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); - PasteboardPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("PasteboardPlugin")); - ScreenBrightnessWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin")); - ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); - SeriousPythonWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SeriousPythonWindowsPluginCApi")); - SharePlusWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); - WindowManagerPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("WindowManagerPlugin")); - WindowToFrontPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("WindowToFrontPlugin")); -} diff --git a/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.h b/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d85..00000000 --- a/src/serious_python/example/flet_example/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake b/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake deleted file mode 100644 index ec8b95fd..00000000 --- a/src/serious_python/example/flet_example/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - battery_plus - connectivity_plus - pasteboard - screen_brightness_windows - screen_retriever_windows - serious_python_windows - share_plus - url_launcher_windows - window_manager - window_to_front -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST - jni -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/src/serious_python/example/flet_example/windows/runner/CMakeLists.txt b/src/serious_python/example/flet_example/windows/runner/CMakeLists.txt deleted file mode 100644 index 394917c0..00000000 --- a/src/serious_python/example/flet_example/windows/runner/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} WIN32 - "flutter_window.cpp" - "main.cpp" - "utils.cpp" - "win32_window.cpp" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" - "Runner.rc" - "runner.exe.manifest" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the build version. -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") - -# Disable Windows macros that collide with C++ standard library functions. -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") - -# Add dependency libraries and include directories. Add any application-specific -# dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/src/serious_python/example/flet_example/windows/runner/Runner.rc b/src/serious_python/example/flet_example/windows/runner/Runner.rc deleted file mode 100644 index 45fe4e1b..00000000 --- a/src/serious_python/example/flet_example/windows/runner/Runner.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#pragma code_page(65001) -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP_ICON ICON "resources\\app_icon.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) -#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD -#else -#define VERSION_AS_NUMBER 1,0,0,0 -#endif - -#if defined(FLUTTER_VERSION) -#define VERSION_AS_STRING FLUTTER_VERSION -#else -#define VERSION_AS_STRING "1.0.0" -#endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VERSION_AS_NUMBER - PRODUCTVERSION VERSION_AS_NUMBER - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "flet_example" "\0" - VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "flet_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "flet_example.exe" "\0" - VALUE "ProductName", "flet_example" "\0" - VALUE "ProductVersion", VERSION_AS_STRING "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/src/serious_python/example/flet_example/windows/runner/flutter_window.cpp b/src/serious_python/example/flet_example/windows/runner/flutter_window.cpp deleted file mode 100644 index 955ee303..00000000 --- a/src/serious_python/example/flet_example/windows/runner/flutter_window.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - - flutter_controller_->engine()->SetNextFrameCallback([&]() { - this->Show(); - }); - - // Flutter can complete the first frame before the "show window" callback is - // registered. The following call ensures a frame is pending to ensure the - // window is shown. It is a no-op if the first frame hasn't completed yet. - flutter_controller_->ForceRedraw(); - - return true; -} - -void FlutterWindow::OnDestroy() { - if (flutter_controller_) { - flutter_controller_ = nullptr; - } - - Win32Window::OnDestroy(); -} - -LRESULT -FlutterWindow::MessageHandler(HWND hwnd, UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - // Give Flutter, including plugins, an opportunity to handle window messages. - if (flutter_controller_) { - std::optional result = - flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, - lparam); - if (result) { - return *result; - } - } - - switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; - } - - return Win32Window::MessageHandler(hwnd, message, wparam, lparam); -} diff --git a/src/serious_python/example/flet_example/windows/runner/flutter_window.h b/src/serious_python/example/flet_example/windows/runner/flutter_window.h deleted file mode 100644 index 6da0652f..00000000 --- a/src/serious_python/example/flet_example/windows/runner/flutter_window.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/src/serious_python/example/flet_example/windows/runner/main.cpp b/src/serious_python/example/flet_example/windows/runner/main.cpp deleted file mode 100644 index ea917ad4..00000000 --- a/src/serious_python/example/flet_example/windows/runner/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.Create(L"flet_example", origin, size)) { - return EXIT_FAILURE; - } - window.SetQuitOnClose(true); - - ::MSG msg; - while (::GetMessage(&msg, nullptr, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - ::CoUninitialize(); - return EXIT_SUCCESS; -} diff --git a/src/serious_python/example/flet_example/windows/runner/resource.h b/src/serious_python/example/flet_example/windows/runner/resource.h deleted file mode 100644 index 66a65d1e..00000000 --- a/src/serious_python/example/flet_example/windows/runner/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/src/serious_python/example/flet_example/windows/runner/resources/app_icon.ico b/src/serious_python/example/flet_example/windows/runner/resources/app_icon.ico deleted file mode 100644 index c04e20ca..00000000 Binary files a/src/serious_python/example/flet_example/windows/runner/resources/app_icon.ico and /dev/null differ diff --git a/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest b/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest deleted file mode 100644 index 153653e8..00000000 --- a/src/serious_python/example/flet_example/windows/runner/runner.exe.manifest +++ /dev/null @@ -1,14 +0,0 @@ - - - - - PerMonitorV2 - - - - - - - - - diff --git a/src/serious_python/example/flet_example/windows/runner/utils.cpp b/src/serious_python/example/flet_example/windows/runner/utils.cpp deleted file mode 100644 index 3a0b4651..00000000 --- a/src/serious_python/example/flet_example/windows/runner/utils.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - unsigned int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); - std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { - return utf8_string; - } - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - input_length, utf8_string.data(), target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} diff --git a/src/serious_python/example/flet_example/windows/runner/utils.h b/src/serious_python/example/flet_example/windows/runner/utils.h deleted file mode 100644 index 3879d547..00000000 --- a/src/serious_python/example/flet_example/windows/runner/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ diff --git a/src/serious_python/example/flet_example/windows/runner/win32_window.cpp b/src/serious_python/example/flet_example/windows/runner/win32_window.cpp deleted file mode 100644 index 60608d0f..00000000 --- a/src/serious_python/example/flet_example/windows/runner/win32_window.cpp +++ /dev/null @@ -1,288 +0,0 @@ -#include "win32_window.h" - -#include -#include - -#include "resource.h" - -namespace { - -/// Window attribute that enables dark mode window decorations. -/// -/// Redefined in case the developer's machine has a Windows SDK older than -/// version 10.0.22000.0. -/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute -#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE -#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 -#endif - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -/// Registry key for app theme preference. -/// -/// A value of 0 indicates apps should use dark mode. A non-zero or missing -/// value indicates apps should use light mode. -constexpr const wchar_t kGetPreferredBrightnessRegKey[] = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; -constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; - -// The number of Win32Window objects that currently exist. -static int g_active_window_count = 0; - -using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); - -// Scale helper to convert logical scaler values to physical using passed in -// scale factor -int Scale(int source, double scale_factor) { - return static_cast(source * scale_factor); -} - -// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. -// This API is only needed for PerMonitor V1 awareness mode. -void EnableFullDpiSupportIfAvailable(HWND hwnd) { - HMODULE user32_module = LoadLibraryA("User32.dll"); - if (!user32_module) { - return; - } - auto enable_non_client_dpi_scaling = - reinterpret_cast( - GetProcAddress(user32_module, "EnableNonClientDpiScaling")); - if (enable_non_client_dpi_scaling != nullptr) { - enable_non_client_dpi_scaling(hwnd); - } - FreeLibrary(user32_module); -} - -} // namespace - -// Manages the Win32Window's window class registration. -class WindowClassRegistrar { - public: - ~WindowClassRegistrar() = default; - - // Returns the singleton registrar instance. - static WindowClassRegistrar* GetInstance() { - if (!instance_) { - instance_ = new WindowClassRegistrar(); - } - return instance_; - } - - // Returns the name of the window class, registering the class if it hasn't - // previously been registered. - const wchar_t* GetWindowClass(); - - // Unregisters the window class. Should only be called if there are no - // instances of the window. - void UnregisterWindowClass(); - - private: - WindowClassRegistrar() = default; - - static WindowClassRegistrar* instance_; - - bool class_registered_ = false; -}; - -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; - -const wchar_t* WindowClassRegistrar::GetWindowClass() { - if (!class_registered_) { - WNDCLASS window_class{}; - window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - window_class.lpszClassName = kWindowClassName; - window_class.style = CS_HREDRAW | CS_VREDRAW; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = GetModuleHandle(nullptr); - window_class.hIcon = - LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); - window_class.hbrBackground = 0; - window_class.lpszMenuName = nullptr; - window_class.lpfnWndProc = Win32Window::WndProc; - RegisterClass(&window_class); - class_registered_ = true; - } - return kWindowClassName; -} - -void WindowClassRegistrar::UnregisterWindowClass() { - UnregisterClass(kWindowClassName, nullptr); - class_registered_ = false; -} - -Win32Window::Win32Window() { - ++g_active_window_count; -} - -Win32Window::~Win32Window() { - --g_active_window_count; - Destroy(); -} - -bool Win32Window::Create(const std::wstring& title, - const Point& origin, - const Size& size) { - Destroy(); - - const wchar_t* window_class = - WindowClassRegistrar::GetInstance()->GetWindowClass(); - - const POINT target_point = {static_cast(origin.x), - static_cast(origin.y)}; - HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); - UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); - double scale_factor = dpi / 96.0; - - HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW, - Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), - Scale(size.width, scale_factor), Scale(size.height, scale_factor), - nullptr, nullptr, GetModuleHandle(nullptr), this); - - if (!window) { - return false; - } - - UpdateTheme(window); - - return OnCreate(); -} - -bool Win32Window::Show() { - return ShowWindow(window_handle_, SW_SHOWNORMAL); -} - -// static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); - SetWindowLongPtr(window, GWLP_USERDATA, - reinterpret_cast(window_struct->lpCreateParams)); - - auto that = static_cast(window_struct->lpCreateParams); - EnableFullDpiSupportIfAvailable(window); - that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { - return that->MessageHandler(window, message, wparam, lparam); - } - - return DefWindowProc(window, message, wparam, lparam); -} - -LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; - } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; - } - - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; - - case WM_DWMCOLORIZATIONCOLORCHANGED: - UpdateTheme(hwnd); - return 0; - } - - return DefWindowProc(window_handle_, message, wparam, lparam); -} - -void Win32Window::Destroy() { - OnDestroy(); - - if (window_handle_) { - DestroyWindow(window_handle_); - window_handle_ = nullptr; - } - if (g_active_window_count == 0) { - WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); - } -} - -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( - GetWindowLongPtr(window, GWLP_USERDATA)); -} - -void Win32Window::SetChildContent(HWND content) { - child_content_ = content; - SetParent(content, window_handle_); - RECT frame = GetClientArea(); - - MoveWindow(content, frame.left, frame.top, frame.right - frame.left, - frame.bottom - frame.top, true); - - SetFocus(child_content_); -} - -RECT Win32Window::GetClientArea() { - RECT frame; - GetClientRect(window_handle_, &frame); - return frame; -} - -HWND Win32Window::GetHandle() { - return window_handle_; -} - -void Win32Window::SetQuitOnClose(bool quit_on_close) { - quit_on_close_ = quit_on_close; -} - -bool Win32Window::OnCreate() { - // No-op; provided for subclasses. - return true; -} - -void Win32Window::OnDestroy() { - // No-op; provided for subclasses. -} - -void Win32Window::UpdateTheme(HWND const window) { - DWORD light_mode; - DWORD light_mode_size = sizeof(light_mode); - LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, - kGetPreferredBrightnessRegValue, - RRF_RT_REG_DWORD, nullptr, &light_mode, - &light_mode_size); - - if (result == ERROR_SUCCESS) { - BOOL enable_dark_mode = light_mode == 0; - DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, - &enable_dark_mode, sizeof(enable_dark_mode)); - } -} diff --git a/src/serious_python/example/flet_example/windows/runner/win32_window.h b/src/serious_python/example/flet_example/windows/runner/win32_window.h deleted file mode 100644 index e901dde6..00000000 --- a/src/serious_python/example/flet_example/windows/runner/win32_window.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates a win32 window with |title| that is positioned and sized using - // |origin| and |size|. New windows are created on the default monitor. Window - // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size this function will scale the inputted width and height as - // as appropriate for the default monitor. The window is invisible until - // |Show| is called. Returns true if the window was created successfully. - bool Create(const std::wstring& title, const Point& origin, const Size& size); - - // Show the current window. Returns true if the window was successfully shown. - bool Show(); - - // Release OS resources associated with window. - void Destroy(); - - // Inserts |content| into the window tree. - void SetChildContent(HWND content); - - // Returns the backing Window handle to enable clients to set icon and other - // window properties. Returns nullptr if the window has been destroyed. - HWND GetHandle(); - - // If true, closing this window will quit the application. - void SetQuitOnClose(bool quit_on_close); - - // Return a RECT representing the bounds of the current client area. - RECT GetClientArea(); - - protected: - // Processes and route salient window messages for mouse handling, - // size change and DPI. Delegates handling of these to member overloads that - // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Called when CreateAndShow is called, allowing subclass window-related - // setup. Subclasses should return false if setup fails. - virtual bool OnCreate(); - - // Called when Destroy is called. - virtual void OnDestroy(); - - private: - friend class WindowClassRegistrar; - - // OS callback called by message pump. Handles the WM_NCCREATE message which - // is passed when the non-client area is being created and enables automatic - // non-client DPI scaling so that the non-client area automatically - // responds to changes in DPI. All other messages are handled by - // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; - - // Update the window frame's theme to match the system theme. - static void UpdateTheme(HWND const window); - - bool quit_on_close_ = false; - - // window handle for top level window. - HWND window_handle_ = nullptr; - - // window handle for hosted content. - HWND child_content_ = nullptr; -}; - -#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/src/serious_python/example/run_example/README.md b/src/serious_python/example/run_example/README.md index 463f3765..571af331 100644 --- a/src/serious_python/example/run_example/README.md +++ b/src/serious_python/example/run_example/README.md @@ -1,11 +1,12 @@ # run_example -Before running the app run the following command to package Python app to an asset. +Before running the app, run the following command to package the Python app for the target platform. For Android: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/python-app dart run serious_python:main package app/src -p Android -r -r -r app/src/requirements.txt ``` @@ -13,6 +14,7 @@ For iOS: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/python-app dart run serious_python:main package app/src -p iOS -r -r -r app/src/requirements.txt ``` @@ -20,6 +22,7 @@ For macOS: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/python-app dart run serious_python:main package app/src -p Darwin -r -r -r app/src/requirements.txt ``` @@ -27,6 +30,7 @@ For Windows: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/python-app dart run serious_python:main package app/src -p Windows -r -r -r app/src/requirements.txt ``` @@ -34,6 +38,7 @@ For Linux: ``` export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages +export SERIOUS_PYTHON_APP=$(pwd)/build/python-app dart run serious_python:main package app/src -p Linux -r -r -r app/src/requirements.txt ``` diff --git a/src/serious_python/example/run_example/app/app.zip.hash b/src/serious_python/example/run_example/app/app.zip.hash deleted file mode 100644 index 615dadf3..00000000 --- a/src/serious_python/example/run_example/app/app.zip.hash +++ /dev/null @@ -1 +0,0 @@ -2b009202b20832851c62f09fd3dc603131d9efa45da27efb94eb21b32da28ed0 \ No newline at end of file diff --git a/src/serious_python/example/run_example/app/src/main.py b/src/serious_python/example/run_example/app/src/main.py index a08b287d..3bea5db6 100644 --- a/src/serious_python/example/run_example/app/src/main.py +++ b/src/serious_python/example/run_example/app/src/main.py @@ -1,12 +1,10 @@ print("Hello from Python program!") +import _imp import os import sys import traceback from pathlib import Path -from time import sleep - -import _imp _imp.extension_suffixes() @@ -58,7 +56,7 @@ def test_numpy_basic(): assert (array([1, 2]) + array([3, 5])).tolist() == [4, 7] return "numpy basic test - OK" - except Exception as e: + except Exception: return f"numpy: test_basic - error: {traceback.format_exc()}" @@ -142,34 +140,38 @@ def test_sqlite(): def test_pyjnius(): - from time import sleep - - from jnius import autoclass - - activity = autoclass(os.getenv("MAIN_ACTIVITY_HOST_CLASS_NAME")).mActivity - Secure = autoclass("android.provider.Settings$Secure") - - version = autoclass("android.os.Build$VERSION") - os_build = autoclass("android.os.Build") - base_os = version.BASE_OS - - DisplayMetrics = autoclass("android.util.DisplayMetrics") - metrics = DisplayMetrics() - - return ( - str(activity.getClass().getName()) - + " os: " - + str(os_build) - + " FLET_JNI_READY: " - + str(os.getenv("FLET_JNI_READY")) - + " DPI: " - + str(metrics.getDeviceDensity()) - ) + # pyjnius is Android-only (needs a JVM + the app's Android classes). On other + # platforms guard it like the other tests so it returns a message instead of + # crashing the script before the result file is written. + try: + from jnius import autoclass + + activity = autoclass(os.getenv("MAIN_ACTIVITY_HOST_CLASS_NAME")).mActivity + Secure = autoclass("android.provider.Settings$Secure") + + version = autoclass("android.os.Build$VERSION") + os_build = autoclass("android.os.Build") + base_os = version.BASE_OS + + DisplayMetrics = autoclass("android.util.DisplayMetrics") + metrics = DisplayMetrics() + + return ( + str(activity.getClass().getName()) + + " os: " + + str(os_build) + + " FLET_JNI_READY: " + + str(os.getenv("FLET_JNI_READY")) + + " DPI: " + + str(metrics.getDeviceDensity()) + ) + except Exception as e: + return f"\npyjnius: not available on this platform - {e}" r += test_sqlite() -# r += test_pyjnius() -# r += test_lru() +r += test_pyjnius() +r += test_lru() r += test_numpy_basic() test_numpy_performance() diff --git a/src/serious_python/example/run_example/app/src/requirements.txt b/src/serious_python/example/run_example/app/src/requirements.txt index 50630e5d..32587b88 100644 --- a/src/serious_python/example/run_example/app/src/requirements.txt +++ b/src/serious_python/example/run_example/app/src/requirements.txt @@ -1,7 +1,3 @@ numpy -#lru-dict -#pyjnius -#flet-libsodium -# pysodium -# numpy -# Pyrebase4 \ No newline at end of file +lru-dict +pyjnius \ No newline at end of file diff --git a/src/serious_python/example/run_example/ios/.gitignore b/src/serious_python/example/run_example/ios/.gitignore index 7a7f9873..c2d46d88 100644 --- a/src/serious_python/example/run_example/ios/.gitignore +++ b/src/serious_python/example/run_example/ios/.gitignore @@ -21,7 +21,6 @@ Flutter/Flutter.podspec Flutter/Generated.xcconfig Flutter/ephemeral/ Flutter/app.flx -Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json diff --git a/src/serious_python/example/run_example/ios/Podfile.lock b/src/serious_python/example/run_example/ios/Podfile.lock index 9bae2c46..3070b44a 100644 --- a/src/serious_python/example/run_example/ios/Podfile.lock +++ b/src/serious_python/example/run_example/ios/Podfile.lock @@ -1,22 +1,15 @@ PODS: - Flutter (1.0.0) - - serious_python_darwin (2.0.0): - - Flutter - - FlutterMacOS DEPENDENCIES: - Flutter (from `Flutter`) - - serious_python_darwin (from `.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: Flutter: :path: Flutter - serious_python_darwin: - :path: ".symlinks/plugins/serious_python_darwin/darwin" SPEC CHECKSUMS: Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 PODFILE CHECKSUM: 4f1c12611da7338d21589c0b2ecd6bd20b109694 diff --git a/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj index 0ac1996c..5ced52ee 100644 --- a/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/run_example/ios/Runner.xcodeproj/project.pbxproj @@ -205,8 +205,6 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 9C2BD3DE6890171FCDB2C70D /* [CP] Embed Pods Frameworks */, - 6071F178056A40A19D0FD492 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -300,23 +298,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 6071F178056A40A19D0FD492 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -332,23 +313,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9C2BD3DE6890171FCDB2C70D /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; B35D7424D749C89CB3E981BE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/src/serious_python/example/run_example/lib/main.dart b/src/serious_python/example/run_example/lib/main.dart index 0a251484..bd554780 100644 --- a/src/serious_python/example/run_example/lib/main.dart +++ b/src/serious_python/example/run_example/lib/main.dart @@ -37,7 +37,7 @@ class _MyAppState extends State { String resultFileName = p.join(tempDir.path, "out.txt"); String resultValue = getRandomString(20); - await SeriousPython.run("app/app.zip", + await SeriousPython.run( environmentVariables: { "RESULT_FILENAME": resultFileName, "RESULT_VALUE": resultValue diff --git a/src/serious_python/example/run_example/macos/Podfile b/src/serious_python/example/run_example/macos/Podfile index b52666a1..dbccf89c 100644 --- a/src/serious_python/example/run_example/macos/Podfile +++ b/src/serious_python/example/run_example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.15' +platform :osx, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/src/serious_python/example/run_example/macos/Podfile.lock b/src/serious_python/example/run_example/macos/Podfile.lock index f59e9b47..e5d522eb 100644 --- a/src/serious_python/example/run_example/macos/Podfile.lock +++ b/src/serious_python/example/run_example/macos/Podfile.lock @@ -1,23 +1,16 @@ PODS: - FlutterMacOS (1.0.0) - - serious_python_darwin (2.0.0): - - Flutter - - FlutterMacOS DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - - serious_python_darwin (from `Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin`) EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral - serious_python_darwin: - :path: Flutter/ephemeral/.symlinks/plugins/serious_python_darwin/darwin SPEC CHECKSUMS: FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 - serious_python_darwin: 6d58c9837595683a71e20114bdd4607568c98e84 -PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 +PODFILE CHECKSUM: c2e95c8c0fe03c5c57e438583cae4cc732296009 COCOAPODS: 1.14.3 diff --git a/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj b/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj index 769f37a0..52de9a7a 100644 --- a/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj +++ b/src/serious_python/example/run_example/macos/Runner.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 60F575BBFB05ECB5BC731F3A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBCD7A366CFB6AA3F26FB79B /* Pods_Runner.framework */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 9A45524B786DA102A205EB20 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D27FB6937DE38CBCB05E2AB /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ @@ -81,6 +82,7 @@ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 3AA9059D78CE7A3AC615A3B2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 8D27FB6937DE38CBCB05E2AB /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; @@ -103,6 +105,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 60F575BBFB05ECB5BC731F3A /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -178,6 +181,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -240,8 +244,6 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 0D22FFDAE571FF7D9AE2FDA7 /* [CP] Embed Pods Frameworks */, - 319F254C714166AC17D0BA17 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -249,6 +251,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* run_example.app */; productType = "com.apple.product-type.application"; @@ -293,6 +298,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -324,40 +332,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0D22FFDAE571FF7D9AE2FDA7 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 319F254C714166AC17D0BA17 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -575,7 +549,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -657,7 +631,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -707,7 +681,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -814,6 +788,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/src/serious_python/example/run_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/serious_python/example/run_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 9391cf32..b91d144c 100644 --- a/src/serious_python/example/run_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/src/serious_python/example/run_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + prepareApp() { + // The platform implementations use method channels / path_provider, which + // require the Flutter binding — ensure it's up so callers can invoke this + // (directly or via [run]) before `runApp()`. + WidgetsFlutterBinding.ensureInitialized(); + return SeriousPythonPlatform.instance.prepareApp(); + } + + /// Runs the packaged Python program. /// - /// If a Python app has a different entry point - /// it could be specified with [appFileName] parameter. + /// The app is resolved via [prepareApp]; by default Serious Python runs + /// `main.py` (or `main.pyc`) in the root of the app directory. If a Python + /// app has a different entry point it can be specified with [appFileName]. + /// + /// The current directory is set to a writable per-app data directory + /// (`/data`) — not the read-only app bundle — so + /// relative file writes (e.g. SQLite databases) work and persist. /// /// Environment variables that must be available to a Python program could /// be passed in [environmentVariables]. @@ -29,31 +46,32 @@ class SeriousPython { /// /// Set [sync] to `true` to sychronously run Python program; otherwise the /// program starts in a new thread. - static Future run(String assetPath, + static Future run( {String? appFileName, List? modulePaths, Map? environmentVariables, bool? sync}) async { - // unpack app from asset - String appPath = ""; - if (path.extension(assetPath) == ".zip") { - appPath = await extractAssetZip(assetPath); - if (appFileName != null) { - appPath = path.join(appPath, appFileName); - } else if (await File(path.join(appPath, "main.pyc")).exists()) { - appPath = path.join(appPath, "main.pyc"); - } else if (await File(path.join(appPath, "main.py")).exists()) { - appPath = path.join(appPath, "main.py"); - } else { - throw Exception( - "App archive must contain either `main.py` or `main.pyc`; otherwise `appFileName` must be specified."); - } + // resolve the app directory (Android unpacks app.zip on first launch) + String appPath = await prepareApp(); + if (appFileName != null) { + appPath = path.join(appPath, appFileName); + } else if (await File(path.join(appPath, "main.pyc")).exists()) { + appPath = path.join(appPath, "main.pyc"); + } else if (await File(path.join(appPath, "main.py")).exists()) { + appPath = path.join(appPath, "main.py"); } else { - appPath = await extractAsset(assetPath); + throw Exception( + "App must contain either `main.py` or `main.pyc`; otherwise `appFileName` must be specified."); } - // set current directory to app path - Directory.current = path.dirname(appPath); + // set current directory to a writable per-app data dir (not the read-only + // app bundle) + final supportDir = await getApplicationSupportDirectory(); + final dataDir = Directory(path.join(supportDir.path, "data")); + if (!await dataDir.exists()) { + await dataDir.create(recursive: true); + } + Directory.current = dataDir.path; // run python program return runProgram(appPath, diff --git a/src/serious_python/lib/src/python_bridge.dart b/src/serious_python/lib/src/python_bridge.dart index 5c69d6e7..d610f0dc 100644 --- a/src/serious_python/lib/src/python_bridge.dart +++ b/src/serious_python/lib/src/python_bridge.dart @@ -30,7 +30,7 @@ import 'package:serious_python_platform_interface/serious_python_platform_interf /// ui.messages.listen((Uint8List bytes) { /* UI events */ }); /// logs.messages.listen((Uint8List bytes) { /* log lines */ }); /// -/// await SeriousPython.run('app/main.py', environmentVariables: { +/// await SeriousPython.run(environmentVariables: { /// 'MY_APP_UI_PORT': '${ui.port}', /// 'MY_APP_LOGS_PORT': '${logs.port}', /// }); diff --git a/src/serious_python/lib/src/python_versions.dart b/src/serious_python/lib/src/python_versions.dart index 27f20ac9..fed44557 100644 --- a/src/serious_python/lib/src/python_versions.dart +++ b/src/serious_python/lib/src/python_versions.dart @@ -1,5 +1,5 @@ // GENERATED by `dart run serious_python:gen_version_tables` from python-build's -// manifest.json (release 20260618). Do not edit by hand — edit python-build's +// manifest.json (release 20260621). Do not edit by hand — edit python-build's // manifest.json, cut a release, bump `pythonReleaseDate`, and regenerate. const pythonVersionEnvironmentVariable = "SERIOUS_PYTHON_VERSION"; @@ -10,7 +10,7 @@ const pyodideVersionEnvironmentVariable = "SERIOUS_PYTHON_PYODIDE_VERSION"; const dartBridgeVersionEnvironmentVariable = "DART_BRIDGE_VERSION"; /// python-build release the bundled runtimes come from (YYYYMMDD). -const pythonReleaseDate = "20260618"; +const pythonReleaseDate = "20260621"; const dartBridgeVersion = "1.4.0"; const defaultPythonVersion = "3.14"; diff --git a/src/serious_python/pubspec.yaml b/src/serious_python/pubspec.yaml index 610c1ca7..8839d397 100644 --- a/src/serious_python/pubspec.yaml +++ b/src/serious_python/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 3.0.0 +version: 4.0.0 platforms: ios: diff --git a/src/serious_python_android/CHANGELOG.md b/src/serious_python_android/CHANGELOG.md index 2476b774..f6a44a9a 100644 --- a/src/serious_python_android/CHANGELOG.md +++ b/src/serious_python_android/CHANGELOG.md @@ -1,3 +1,12 @@ +## 4.0.0 + +* Ship the app as a *stored* `app.zip` asset in the APK and unpack it once (version-keyed) to `/flet/app` on the first launch after install/update, via the new `prepareApp()`. The version-keyed unpack moved out of `run()`; user data in the sibling `/data` is preserved across updates. +* Resolve the support dir via `path_provider` `getApplicationSupportDirectory()` (== `context.getFilesDir()`) and drop the custom `getFilesDir` method channel; the payload base moves from `flet/py` to `flet/`. +* Synthesize an empty `__init__.py` for `__init__`-less package directories when building `stdlib.zip`/`sitepackages.zip`, so `zipimport` can import PEP 420 namespace packages (e.g. `flask.sansio`). +* `SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES` entries now support `*`/`?` wildcards matched against the top-level name (e.g. `flask*` also extracts `flask-.dist-info/`). +* Restore `pyjnius` support under the FFI model: re-add the `loadLibrary` method channel and load its JNI helper (`libpyjni.so`) via Java `System.loadLibrary` before the interpreter starts, so the helper's `JNI_OnLoad` captures the `JavaVM` + app ClassLoader (`dart:ffi`'s `dlopen` for `libdart_bridge` never triggers `JNI_OnLoad`). Best-effort — a no-op for apps that don't depend on pyjnius. +* Version bump aligning with the `serious_python_*` 4.0.0 release. + ## 3.0.0 * **In-process Python (dart_bridge FFI).** The Python lifecycle now runs through `libdart_bridge.so` (from `flet-dev/dart-bridge` **1.4.0**) instead of a socket transport. diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts index c277c822..a34b3d28 100644 --- a/src/serious_python_android/android/build.gradle.kts +++ b/src/serious_python_android/android/build.gradle.kts @@ -21,7 +21,7 @@ buildscript { } group = "com.flet.serious_python_android" -version = "3.0.0" +version = "4.0.0" rootProject.allprojects { repositories { @@ -114,8 +114,25 @@ val siteSrcDir: String? = System.getenv("SERIOUS_PYTHON_SITE_PACKAGES") // name) at each module's path in the pure zip. Pure code ships in ABI-common // stored zips; path-hungry packages from SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES // are moved whole into extract.zip and excluded from sitepackages.zip. +// +// Each entry matches either an exact path or anything under it (`flask` -> +// flask/...). An entry containing a `*` or `?` wildcard is a glob matched +// against the top-level path component, so `flask*` also catches the sibling +// `flask-.dist-info/` (and any `flask_*` package). val extractPackages: List = (System.getenv("SERIOUS_PYTHON_ANDROID_EXTRACT_PACKAGES") ?: "") .split(",").map { it.trim() }.filter { it.isNotEmpty() } +fun globToRegex(glob: String): Regex = + Regex(glob.map { c -> + when (c) { + '*' -> ".*" + '?' -> "." + else -> Regex.escape(c.toString()) + } + }.joinToString("")) +val extractGlobs: List = + extractPackages.filter { '*' in it || '?' in it }.map(::globToRegex) +val extractPlain: List = + extractPackages.filter { '*' !in it && '?' !in it } val primaryAbi = abis.first() // pure zips are ABI-common: build once val assetsDir = file("src/main/assets") val bootstrapPy = file("../python/_sp_bootstrap.py") @@ -129,11 +146,14 @@ fun extDottedName(rel: String): String { // slash-rel path -> dott } fun mangledLib(dotted: String) = "lib" + dotted.replace('.', '-') + ".so" fun sorefPath(rel: String) = rel.replace(extTag, ".soref") -fun isAllowlisted(rel: String) = extractPackages.any { rel == it || rel.startsWith("$it/") } +fun isAllowlisted(rel: String): Boolean = + extractPlain.any { rel == it || rel.startsWith("$it/") } || + (extractGlobs.isNotEmpty() && extractGlobs.any { it.matches(rel.substringBefore('/')) }) // Minimal STORED (uncompressed) zip so members stay readable via zipimport.get_data // with no zlib at runtime. class StoredZip(val out: ZipOutputStream) { + private val names = mutableSetOf() fun add(name: String, data: ByteArray) { val e = ZipEntry(name).apply { method = ZipEntry.STORED @@ -142,6 +162,31 @@ class StoredZip(val out: ZipOutputStream) { crc = CRC32().apply { update(data) }.value } out.putNextEntry(e); out.write(data); out.closeEntry() + names.add(name) + } + // zipimport cannot import PEP 420 namespace packages — package directories + // with no __init__.py (e.g. flask's `flask/sansio/`). On a real filesystem + // the path finder imports them implicitly, but inside a stored zip served by + // zipimport they're invisible. Inject an empty __init__.py into every package + // dir that has importable content (a .py/.pyc/.soref module) but no __init__, + // turning namespace packages into regular ones zipimport can resolve. Call + // before close(). (Not needed for extract.zip — that's unpacked to disk.) + fun synthesizePackageInits() { + val moduleExts = listOf(".py", ".pyc", ".soref") + val pkgDirs = sortedSetOf() + for (n in names) { + if (moduleExts.none { n.endsWith(it) }) continue + if (n.split('/').any { it == "__pycache__" }) continue + var dir = n.substringBeforeLast('/', "") + while (dir.isNotEmpty()) { + pkgDirs.add(dir) + dir = dir.substringBeforeLast('/', "") + } + } + for (d in pkgDirs) { + if ("$d/__init__.py" in names || "$d/__init__.pyc" in names) continue + add("$d/__init__.py", ByteArray(0)) + } } fun close() = out.close() } @@ -247,6 +292,7 @@ for (abi in abis) { // The dart-bridge Android shim (F) installs the finder before `site`. A // sitecustomize fallback can be re-enabled for bridges without that shim: // zip?.add("sitecustomize.py", "import _sp_bootstrap\n_sp_bootstrap.install()\n".toByteArray()) + zip?.synthesizePackageInits() zip?.close() bundleFile.delete() // fake-zip must not ship } @@ -278,6 +324,7 @@ for (abi in abis) { else -> zip?.add(rel, f.readBytes()) } } + siteZip?.synthesizePackageInits() siteZip?.close() extractZip?.close() } @@ -315,6 +362,28 @@ for (abi in abis) { packageTasks.add("copyDartBridge_$abi") } +// The app's Python sources (already processed by serious_python's `package` +// command into SERIOUS_PYTHON_APP) ship as a STORED, ABI-common `app.zip` +// asset alongside stdlib.zip/sitepackages.zip; the plugin unpacks it to the +// files dir on first launch (version-keyed). Built once, regardless of ABI. +val appSrcDir: String? = System.getenv("SERIOUS_PYTHON_APP") +tasks.register("packageApp") { + outputs.dir(assetsDir) + outputs.upToDateWhen { false } + doLast { + if (appSrcDir == null || appSrcDir.isBlank()) return@doLast + val appDir = File(appSrcDir) + if (!appDir.isDirectory) + throw GradleException("serious_python: SERIOUS_PYTHON_APP dir not found: $appSrcDir") + val zip = storedZip(File(assetsDir, "app.zip")) + appDir.walkTopDown().filter { it.isFile }.forEach { f -> + val rel = f.relativeTo(appDir).path.replace(File.separatorChar, '/') + zip.add(rel, f.readBytes()) + } + zip.close() + } +} + val copyOrUntar = tasks.register("copyOrUntar") { if (System.getenv("SERIOUS_PYTHON_BUILD_DIST") != null) { dependsOn("copyBuildDist") @@ -324,5 +393,5 @@ val copyOrUntar = tasks.register("copyOrUntar") { } tasks.named("preBuild") { - dependsOn(copyOrUntar) + dependsOn(copyOrUntar, "packageApp") } diff --git a/src/serious_python_android/android/python_versions.properties b/src/serious_python_android/android/python_versions.properties index 2fc624e2..41d4ec16 100644 --- a/src/serious_python_android/android/python_versions.properties +++ b/src/serious_python_android/android/python_versions.properties @@ -1,8 +1,8 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260618). Do not edit by hand. +# python-build manifest.json (release 20260621). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260618 +python_build_release_date=20260621 3.12.full_version=3.12.13 3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 diff --git a/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java b/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java index 54ba8f80..e207744f 100644 --- a/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java +++ b/src/serious_python_android/android/src/main/java/com/flet/serious_python_android/AndroidPlugin.java @@ -103,8 +103,18 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { } catch (Exception e) { result.error("Error", e.getMessage(), null); } - } else if (call.method.equals("getFilesDir")) { - result.success(context.getFilesDir().getAbsolutePath()); + } else if (call.method.equals("loadLibrary")) { + // Load a native library by name via Java's System.loadLibrary(), which — + // unlike dart:ffi's dlopen-based DynamicLibrary.open used for + // libdart_bridge — runs the library's JNI_OnLoad. That's how pyjnius's + // helper (libpyjni.so) captures the JavaVM + app ClassLoader. Called from + // app code here, so JNI_OnLoad sees the app's class loader. + try { + System.loadLibrary((String) call.argument("libname")); + result.success(null); + } catch (Throwable e) { + result.error("loadLibrary", e.getMessage(), null); + } } else if (call.method.equals("extractAsset")) { // Stream an APK asset to disk as one whole file (e.g. stdlib.zip). try { diff --git a/src/serious_python_android/lib/serious_python_android.dart b/src/serious_python_android/lib/serious_python_android.dart index 7c7d4997..3b3f779b 100644 --- a/src/serious_python_android/lib/serious_python_android.dart +++ b/src/serious_python_android/lib/serious_python_android.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:path/path.dart' as p; +import 'package:path_provider/path_provider.dart'; import 'package:serious_python_platform_interface/serious_python_platform_interface.dart'; /// Android implementation of [SeriousPythonPlatform]. @@ -13,11 +14,12 @@ import 'package:serious_python_platform_interface/serious_python_platform_interf /// `downloadDartBridge_` tasks). /// /// This class: -/// 1. Pulls the python.bundle (zipped stdlib + dynload .so files) out of the -/// APK's nativeLibraryDir into a writable app-support directory, since -/// CPython can't import from inside the .apk. -/// 2. Builds env vars + sys.path entries and hands them to `serious_python_run` -/// in a single FFI call. +/// 1. In [prepareApp], copies the stored asset zips (stdlib / sitepackages / +/// extract / app) out of the APK into the app-support directory once +/// (version-keyed), since CPython can't import from inside the .apk and the +/// app payload must live on a writable path. +/// 2. In [run], builds env vars + sys.path entries (pointing at those copied +/// zips) and hands them to `serious_python_run` in a single FFI call. class SeriousPythonAndroid extends SeriousPythonPlatform { @visibleForTesting final methodChannel = const MethodChannel('android_plugin'); @@ -26,21 +28,19 @@ class SeriousPythonAndroid extends SeriousPythonPlatform { SeriousPythonPlatform.instance = SeriousPythonAndroid(); } + /// The serious_python/flet-owned storage namespace: `/flet`, where + /// `` is `getApplicationSupportDirectory()` (== `context.getFilesDir()` + /// on Android). Holds `{app, stdlib.zip, sitepackages.zip, extract/, .key}`. + /// The sibling `/data` (user data / cwd) is never touched here. + Future _base() async { + final support = await getApplicationSupportDirectory(); + return p.join(support.path, 'flet'); + } + @override - Future run(String appPath, - {String? script, - List? modulePaths, - Map? environmentVariables, - bool? sync}) async { - // Native extension modules now live in jniLibs (loaded by basename via the - // finder); pure code ships in stored Android-asset zips. Copy the zips to disk - // once (version-keyed) and unpack the allowlist payload; PYTHONPATH points at - // the zips so zipimport serves pure modules in place. - final filesDir = await methodChannel.invokeMethod('getFilesDir'); - if (filesDir == null) { - throw StateError('serious_python: failed to resolve files dir'); - } - final base = p.join(filesDir, 'flet', 'py'); + Future prepareApp() async { + final base = await _base(); + final appDir = p.join(base, 'app'); final stdlibZip = p.join(base, 'stdlib.zip'); final siteZip = p.join(base, 'sitepackages.zip'); final extractDir = p.join(base, 'extract'); @@ -52,18 +52,42 @@ class SeriousPythonAndroid extends SeriousPythonPlatform { await marker.exists() && (await marker.readAsString()) == key; if (!upToDate) { await Directory(base).create(recursive: true); - if (await Directory(extractDir).exists()) { - await Directory(extractDir).delete(recursive: true); + // Re-materialize the unpacked trees; leave the sibling `/data` + // (user data) alone — it must survive app updates. + for (final dir in [appDir, extractDir]) { + if (await Directory(dir).exists()) { + await Directory(dir).delete(recursive: true); + } } + // Pure-code zips imported in place via zipimport (streamed whole to disk). await methodChannel.invokeMethod( 'extractAsset', {'asset': 'stdlib.zip', 'dest': stdlibZip}); await methodChannel.invokeMethod( 'extractAsset', {'asset': 'sitepackages.zip', 'dest': siteZip}); + // Path-hungry packages + the app payload are unpacked to disk. await methodChannel.invokeMethod( 'unzipAsset', {'asset': 'extract.zip', 'dest': extractDir}); + await methodChannel + .invokeMethod('unzipAsset', {'asset': 'app.zip', 'dest': appDir}); await marker.writeAsString(key); } + return appDir; + } + + @override + Future run(String appPath, + {String? script, + List? modulePaths, + Map? environmentVariables, + bool? sync}) async { + // [prepareApp] has already materialized everything; recompute the paths + // (deterministic from the support dir) — no unpacking here. + final base = await _base(); + final stdlibZip = p.join(base, 'stdlib.zip'); + final siteZip = p.join(base, 'sitepackages.zip'); + final extractDir = p.join(base, 'extract'); + final programDir = p.dirname(appPath); // Highest -> lowest precedence. site-packages before stdlib so pip backports // can override; extract-dir before sitepackages.zip. Natives resolve via the @@ -76,6 +100,21 @@ class SeriousPythonAndroid extends SeriousPythonPlatform { stdlibZip, ]; + // pyjnius support: load its JNI helper (libpyjni.so, from the flet-libpyjni + // dependency) via Java's `System.loadLibrary`, which runs its JNI_OnLoad — + // capturing the JavaVM + app ClassLoader that pyjnius's `PyJni_*` calls rely + // on. `dart:ffi`'s dlopen (used for libdart_bridge) never triggers + // JNI_OnLoad, so this Java-side load must happen before the interpreter + // imports `jnius`. Best-effort: a no-op (UnsatisfiedLinkError) for apps that + // don't depend on pyjnius, since libpyjni.so isn't bundled then. + var jniReady = false; + try { + await methodChannel.invokeMethod('loadLibrary', {'libname': 'pyjni'}); + jniReady = true; + } catch (_) { + // pyjnius not in use (or libpyjni.so absent) — nothing to do. + } + final env = { 'PYTHONINSPECT': '1', 'PYTHONDONTWRITEBYTECODE': '1', @@ -84,6 +123,7 @@ class SeriousPythonAndroid extends SeriousPythonPlatform { 'LC_CTYPE': 'UTF-8', 'PYTHONHOME': base, 'PYTHONPATH': pythonPaths.join(':'), + if (jniReady) 'FLET_JNI_READY': '1', ...?environmentVariables, }; diff --git a/src/serious_python_android/pubspec.yaml b/src/serious_python_android/pubspec.yaml index a96d2251..dcba567a 100644 --- a/src/serious_python_android/pubspec.yaml +++ b/src/serious_python_android/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_android description: Android implementation of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 3.0.0 +version: 4.0.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -15,6 +15,7 @@ dependencies: serious_python_platform_interface: path: ../serious_python_platform_interface path: ^1.9.0 + path_provider: ^2.1.3 dev_dependencies: flutter_test: diff --git a/src/serious_python_darwin/CHANGELOG.md b/src/serious_python_darwin/CHANGELOG.md index 0e217db7..af7f33a2 100644 --- a/src/serious_python_darwin/CHANGELOG.md +++ b/src/serious_python_darwin/CHANGELOG.md @@ -1,3 +1,12 @@ +## 4.0.0 + +* **Swift Package Manager support (dual with CocoaPods).** The plugin now builds under SPM as well as CocoaPods, so apps can use either integration (CocoaPods goes read-only in December 2026; Flutter ships SPM on by default since 3.44). A new `darwin/serious_python_darwin/Package.swift` builds the same Swift source as the podspec, with `getResourcePath` resolving `Bundle.module` under SPM (`#if SWIFT_PACKAGE`) and the framework `python.bundle` under CocoaPods. + * SPM has no pod-install hook, so the staging the podspec `prepare_command` does runs on the host before `flutter build` instead: `prepare_spm.sh` assembles the dist (`prepare_.sh` + `sync_site_packages.sh`) and `stage_spm.sh` maps it into the package layout — `Python-{ios,macos}.xcframework` + `dart_bridge.xcframework` as local-path binary targets, the iOS native C-extensions enumerated from `extra-xcframeworks/`, and `stdlib`/`site-packages`/`app` as `.copy` resources. On iOS the extensions ship as embedded, signed frameworks (CPython's `.fwork` finder resolves them); on macOS they load flat from the resource trees. + * The manifest reads `SP_NATIVE_SET` (a hash of the staged native set) so SwiftPM re-resolves when requirements / app / Python version change — SwiftPM caches its package graph on manifest text + environment, not on the staged dirs it enumerates. + * The **SPM path** needs Flutter **3.44** / Dart **3.11**; the plugin's minimum is unchanged because `Package.swift` is dormant on older Flutter (which uses the CocoaPods path). +* `prepareApp()` returns the app dir from the `python.bundle` resource (`/app`); the app's Python sources ship unpacked as an `app` resource bundle next to `stdlib` + `site-packages` (no first-launch extraction). +* Version bump aligning with the `serious_python_*` 4.0.0 release. + ## 3.0.0 * **In-process Python (dart_bridge FFI).** The Python lifecycle is absorbed into `dart_bridge.xcframework` (from `flet-dev/dart-bridge` **1.4.0**) instead of a socket transport; the Swift plugin registers the dart_bridge inittab, the pod is declared `static_framework` for xcframework vendoring, and the embedded `Python.app` is stripped from `Python.framework`. diff --git a/src/serious_python_darwin/darwin/.gitignore b/src/serious_python_darwin/darwin/.gitignore index 0c885071..52f39d72 100644 --- a/src/serious_python_darwin/darwin/.gitignore +++ b/src/serious_python_darwin/darwin/.gitignore @@ -35,4 +35,15 @@ Icon? /Flutter/Generated.xcconfig /Flutter/ephemeral/ -/Flutter/flutter_export_environment.sh \ No newline at end of file +/Flutter/flutter_export_environment.sh + +# --- SwiftPM staging (materialized by serious_python's package step) --- +serious_python_darwin/Python-ios.xcframework +serious_python_darwin/Python-macos.xcframework +serious_python_darwin/dart_bridge.xcframework +serious_python_darwin/extra-xcframeworks/ +serious_python_darwin/.build/ +serious_python_darwin/.swiftpm/ +# resource trees are staged; keep only the committed .keep placeholders +serious_python_darwin/Sources/serious_python_darwin/Resources/*/* +!serious_python_darwin/Sources/serious_python_darwin/Resources/*/.keep diff --git a/src/serious_python_darwin/darwin/prepare_ios.sh b/src/serious_python_darwin/darwin/prepare_ios.sh index 817ae1ae..279c99b8 100755 --- a/src/serious_python_darwin/darwin/prepare_ios.sh +++ b/src/serious_python_darwin/darwin/prepare_ios.sh @@ -11,7 +11,11 @@ dist=$script_dir/dist_ios # Cross-plugin download cache; see prepare_macos.sh for the convention. cache_root="${FLET_CACHE_DIR:-$HOME/.flet/cache}" -pb_cache="$cache_root/python-build/v$python_full_version" +# Date-keyed: a re-release of the same Python version (same 3.x.y, new build +# date — e.g. a rebuild that only re-signs binaries) downloads fresh instead of +# being served stale from the previous release's cache. dart-bridge stays +# version-keyed (its re-releases bump the version). +pb_cache="$cache_root/python-build/v$python_full_version-$python_build_date" db_cache="$cache_root/dart-bridge/v$dart_bridge_version" mkdir -p "$pb_cache" "$db_cache" @@ -25,17 +29,19 @@ if [ ! -f "$python_ios_dist_path" ]; then fi # Re-extract when $dist is missing OR was assembled for a different Python -# version. The guard used to be `[ ! -d "$dist" ]`, which left a stale dist_ios -# from a previous Python version in place — e.g. bundling 3.12 under 3.14 -# site-packages, which trips C-extension ABI errors ("unknown slot ID") at -# import. A version marker keys the extracted dist to $python_full_version. -marker="$dist/.python_full_version" -if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$python_full_version" ]; then +# version/release. The guard used to be `[ ! -d "$dist" ]`, which left a stale +# dist_ios from a previous Python version in place — e.g. bundling 3.12 under +# 3.14 site-packages, which trips C-extension ABI errors ("unknown slot ID") at +# import. The marker keys the extracted dist to the version + release date, so a +# same-version re-release (new build date) also re-extracts. +build_id="$python_full_version-$python_build_date" +marker="$dist/.python_build_id" +if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$build_id" ]; then rm -rf "$dist" mkdir -p "$dist" tar -xzf "$python_ios_dist_path" -C "$dist" mv "$dist/python-stdlib" "$dist/stdlib" - echo "$python_full_version" > "$marker" + echo "$build_id" > "$marker" fi # ---- flet-dev/dart-bridge (xcframework) ----------------------------------- diff --git a/src/serious_python_darwin/darwin/prepare_macos.sh b/src/serious_python_darwin/darwin/prepare_macos.sh index 1e4479ce..251c0a39 100755 --- a/src/serious_python_darwin/darwin/prepare_macos.sh +++ b/src/serious_python_darwin/darwin/prepare_macos.sh @@ -12,7 +12,11 @@ dist=$script_dir/dist_macos # gradle task + flet build's external tooling already use; ~/.flet/cache is # the shared default. Tarballs land here and survive `flutter clean`. cache_root="${FLET_CACHE_DIR:-$HOME/.flet/cache}" -pb_cache="$cache_root/python-build/v$python_full_version" +# Date-keyed: a re-release of the same Python version (same 3.x.y, new build +# date — e.g. a rebuild that only re-signs binaries) downloads fresh instead of +# being served stale from the previous release's cache. dart-bridge stays +# version-keyed (its re-releases bump the version). +pb_cache="$cache_root/python-build/v$python_full_version-$python_build_date" db_cache="$cache_root/dart-bridge/v$dart_bridge_version" mkdir -p "$pb_cache" "$db_cache" @@ -27,12 +31,14 @@ if [ ! -f "$python_macos_dist_path" ]; then fi # Re-extract when $dist is missing OR was assembled for a different Python -# version. The guard used to be `[ ! -d "$dist" ]`, which left a stale dist_macos -# from a previous Python version in place — e.g. bundling 3.12 under 3.14 -# site-packages, which trips C-extension ABI errors ("unknown slot ID") at -# import. A version marker keys the extracted dist to $python_full_version. -marker="$dist/.python_full_version" -if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$python_full_version" ]; then +# version/release. The guard used to be `[ ! -d "$dist" ]`, which left a stale +# dist_macos from a previous Python version in place — e.g. bundling 3.12 under +# 3.14 site-packages, which trips C-extension ABI errors ("unknown slot ID") at +# import. The marker keys the extracted dist to the version + release date, so a +# same-version re-release (new build date) also re-extracts. +build_id="$python_full_version-$python_build_date" +marker="$dist/.python_build_id" +if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$build_id" ]; then rm -rf "$dist" mkdir -p "$dist" tar -xzf "$python_macos_dist_path" -C "$dist" @@ -48,7 +54,7 @@ if [ ! -d "$dist" ] || [ "$(cat "$marker" 2>/dev/null)" != "$python_full_version # unexpectedly" crash dialog. We don't need this launcher for embedded # use; libdart_bridge dlopens Python.framework's main binary directly. find "$dist/xcframeworks" -type d -name 'Python.app' -prune -exec rm -rf {} + - echo "$python_full_version" > "$marker" + echo "$build_id" > "$marker" fi # ---- flet-dev/dart-bridge (xcframework, same archive for macOS + iOS) ----- diff --git a/src/serious_python_darwin/darwin/prepare_spm.sh b/src/serious_python_darwin/darwin/prepare_spm.sh new file mode 100755 index 00000000..97aaee35 --- /dev/null +++ b/src/serious_python_darwin/darwin/prepare_spm.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail +# +# prepare_spm.sh +# +# Host-side equivalent of the podspec `prepare_command` for the Swift Package +# Manager build path (SPM has no pod-install hook). Downloads + extracts the +# Python/dart_bridge dist, syncs the app + site-packages into it, and maps the +# result into the SPM plugin layout. Prints SP_NATIVE_SET (the cache-bust key) +# on stdout; all progress goes to stderr so the caller can capture just the key. +# +# Version coordinates resolve from python_versions.properties (overridable via +# the same env vars the podspec honors), so the caller only passes the platform. +# +platform=${1:?usage: prepare_spm.sh } +script_dir=$(cd "$(dirname "$0")" && pwd -P) +props="$script_dir/python_versions.properties" + +prop() { grep "^$1=" "$props" 2>/dev/null | head -1 | cut -d= -f2-; } + +pyver=${SERIOUS_PYTHON_VERSION:-$(prop default_python_version)} +pyfull=${SERIOUS_PYTHON_FULL_VERSION:-$(prop "$pyver.full_version")} +builddate=${SERIOUS_PYTHON_BUILD_DATE:-$(prop python_build_release_date)} +dbver=${DART_BRIDGE_VERSION:-$(prop dart_bridge_version)} +[ -n "$pyfull" ] || { echo "prepare_spm: unknown SERIOUS_PYTHON_VERSION '$pyver'" >&2; exit 1; } + +echo "prepare_spm: $platform python=$pyfull build=$builddate dart_bridge=$dbver" >&2 +"$script_dir/prepare_$platform.sh" "$pyver" "$pyfull" "$builddate" "$dbver" >&2 +"$script_dir/sync_site_packages.sh" >&2 +SERIOUS_PYTHON_FULL_VERSION="$pyfull" "$script_dir/stage_spm.sh" "$platform" diff --git a/src/serious_python_darwin/darwin/python_versions.properties b/src/serious_python_darwin/darwin/python_versions.properties index 2fc624e2..41d4ec16 100644 --- a/src/serious_python_darwin/darwin/python_versions.properties +++ b/src/serious_python_darwin/darwin/python_versions.properties @@ -1,8 +1,8 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260618). Do not edit by hand. +# python-build manifest.json (release 20260621). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260618 +python_build_release_date=20260621 3.12.full_version=3.12.13 3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 diff --git a/src/serious_python_darwin/darwin/serious_python_darwin.podspec b/src/serious_python_darwin/darwin/serious_python_darwin.podspec index 809d0bd8..a40434af 100644 --- a/src/serious_python_darwin/darwin/serious_python_darwin.podspec +++ b/src/serious_python_darwin/darwin/serious_python_darwin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'serious_python_darwin' - s.version = '3.0.0' + s.version = '4.0.0' s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.' s.description = <<-DESC A cross-platform plugin for adding embedded Python runtime to your Flutter apps. @@ -19,11 +19,11 @@ Pod::Spec.new do |s| # framework. Python.xcframework is also static, so this was always # implicitly the case — just being explicit now. s.static_framework = true - s.source_files = ['Classes/**/*'] + s.source_files = ['serious_python_darwin/Sources/serious_python_darwin/**/*.swift'] s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '13.0' - s.osx.deployment_target = '10.15' + s.osx.deployment_target = '11.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { @@ -72,7 +72,8 @@ puts `#{prepare_command}` s.ios.resource_bundles = { 'python' => [ "dist_ios/stdlib", - "dist_ios/site-packages" + "dist_ios/site-packages", + "dist_ios/app" ] } @@ -81,7 +82,8 @@ puts `#{prepare_command}` s.osx.resource_bundles = { 'python' => [ "dist_macos/stdlib", - "dist_macos/site-packages" + "dist_macos/site-packages", + "dist_macos/app" ] } end diff --git a/src/serious_python_darwin/darwin/serious_python_darwin/Package.swift b/src/serious_python_darwin/darwin/serious_python_darwin/Package.swift new file mode 100644 index 00000000..bd517d29 --- /dev/null +++ b/src/serious_python_darwin/darwin/serious_python_darwin/Package.swift @@ -0,0 +1,102 @@ +// swift-tools-version: 5.9 +import PackageDescription +import Foundation + +// === serious_python_darwin — Swift Package Manager manifest === +// +// Dual build system: this package builds the plugin under SwiftPM; the sibling +// `serious_python_darwin.podspec` builds the same Sources/ under CocoaPods. +// +// The Python runtime, dart_bridge, the app's native C-extensions, and the +// stdlib/site-packages/app trees are NOT committed. serious_python's `package` +// command (driven by `flet build`) materializes them into THIS package directory +// before `flutter build`, exactly as the CocoaPods `prepare_command` does: +// +// /Python-ios.xcframework, Python-macos.xcframework Python runtime (dynamic) +// /dart_bridge.xcframework FFI transport (static) +// /extra-xcframeworks/*.xcframework iOS native extensions +// (stdlib lib-dynload + site-packages) +// /Sources/serious_python_darwin/Resources/{stdlib,site-packages,app} +// +// On iOS, native extensions ship as embedded+signed frameworks (CPython's finder +// dlopen's them by their bundled path). On macOS they ride flat inside the +// site-packages / stdlib resource trees and load in place. +// +// CACHE-BUST CONTRACT: SwiftPM caches the resolved package graph keyed on this +// manifest's TEXT + the environment variables it reads — NOT on the staged dirs it +// enumerates. So the package step exports `SP_NATIVE_SET`, a hash over everything it +// staged (Python full version, dart_bridge version, the sorted extension set, the +// resource trees). Reading it here makes it a tracked key, so any change to the +// staged inputs forces re-resolution. `SERIOUS_PYTHON_VERSION` (the project's +// version-selection contract) is read for the same reason. +let env = ProcessInfo.processInfo.environment +_ = env["SP_NATIVE_SET"] +_ = env["SERIOUS_PYTHON_VERSION"] + +let pkgDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent() +func staged(_ rel: String) -> Bool { + FileManager.default.fileExists(atPath: pkgDir.appendingPathComponent(rel).path) +} + +// Native binary targets + their plugin-target dependencies. All existence-guarded so +// the manifest still parses in an unstaged checkout (IDE / `dart pub get`); a real +// `flutter build` always stages first. +var binaryTargets: [Target] = [] +var deps: [Target.Dependency] = [.product(name: "FlutterFramework", package: "FlutterFramework")] + +// dart_bridge: static archive, link-only (forced in via -all_load). Multi-platform. +if staged("dart_bridge.xcframework") { + binaryTargets.append(.binaryTarget(name: "dart_bridge", path: "dart_bridge.xcframework")) + deps.append("dart_bridge") +} +// Python.framework: dynamic -> embedded + auto-signed. iOS and macOS ship separate +// xcframeworks, so each is platform-conditional. +if staged("Python-ios.xcframework") { + binaryTargets.append(.binaryTarget(name: "Python_ios", path: "Python-ios.xcframework")) + deps.append(.target(name: "Python_ios", condition: .when(platforms: [.iOS]))) +} +if staged("Python-macos.xcframework") { + binaryTargets.append(.binaryTarget(name: "Python_macos", path: "Python-macos.xcframework")) + deps.append(.target(name: "Python_macos", condition: .when(platforms: [.macOS]))) +} +// iOS native C-extensions: each staged *.xcframework -> embedded+signed framework. +let extraDir = pkgDir.appendingPathComponent("extra-xcframeworks") +if let items = try? FileManager.default.contentsOfDirectory( + at: extraDir, includingPropertiesForKeys: nil) { + for item in items.sorted(by: { $0.lastPathComponent < $1.lastPathComponent }) + where item.pathExtension == "xcframework" { + let name = item.deletingPathExtension().lastPathComponent + binaryTargets.append(.binaryTarget(name: name, path: "extra-xcframeworks/\(name).xcframework")) + deps.append(.target(name: name, condition: .when(platforms: [.iOS]))) + } +} + +let package = Package( + name: "serious_python_darwin", + platforms: [.iOS("13.0"), .macOS("11.0")], + products: [ + .library(name: "serious-python-darwin", targets: ["serious_python_darwin"]), + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework"), + ], + targets: [ + .target( + name: "serious_python_darwin", + dependencies: deps, + resources: [ + // Staged trees. .copy (verbatim) preserves the layout PYTHONHOME / + // PYTHONPATH expect; committed `.keep` placeholders keep these paths + // valid (and Bundle.module generated) in an unstaged checkout. + .copy("Resources/stdlib"), + .copy("Resources/site-packages"), + .copy("Resources/app"), + ], + linkerSettings: [ + // Reproduces the podspec OTHER_LDFLAGS = '-ObjC -all_load -lc++'. + .unsafeFlags(["-ObjC", "-all_load"]), + .linkedLibrary("c++"), + ] + ), + ] + binaryTargets +) diff --git a/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/app/.keep b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/app/.keep new file mode 100644 index 00000000..be174385 --- /dev/null +++ b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/app/.keep @@ -0,0 +1,2 @@ +# Placeholder so the SwiftPM resource path exists in an unstaged checkout; +# serious_python_darwin's package step fills this directory before `flutter build`. diff --git a/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/site-packages/.keep b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/site-packages/.keep new file mode 100644 index 00000000..be174385 --- /dev/null +++ b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/site-packages/.keep @@ -0,0 +1,2 @@ +# Placeholder so the SwiftPM resource path exists in an unstaged checkout; +# serious_python_darwin's package step fills this directory before `flutter build`. diff --git a/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/stdlib/.keep b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/stdlib/.keep new file mode 100644 index 00000000..be174385 --- /dev/null +++ b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/Resources/stdlib/.keep @@ -0,0 +1,2 @@ +# Placeholder so the SwiftPM resource path exists in an unstaged checkout; +# serious_python_darwin's package step fills this directory before `flutter build`. diff --git a/src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/SeriousPythonPlugin.swift similarity index 54% rename from src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift rename to src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/SeriousPythonPlugin.swift index 07224c3d..d676aa0b 100644 --- a/src/serious_python_darwin/darwin/Classes/SeriousPythonPlugin.swift +++ b/src/serious_python_darwin/darwin/serious_python_darwin/Sources/serious_python_darwin/SeriousPythonPlugin.swift @@ -45,25 +45,38 @@ public class SeriousPythonPlugin: NSObject, FlutterPlugin { public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { switch call.method { case "getResourcePath": - // The python.bundle that prepare_{ios,macos}.sh assembles ends up - // inside this plugin's framework bundle as a Resources subbundle. - // Dart calls this to discover the stdlib / site-packages layout - // before invoking `serious_python_run`. - guard let frameworkBundle = Bundle(for: type(of: self)).resourceURL else { - result(FlutterError(code: "FRAMEWORK_BUNDLE_ERROR", - message: "Failed to get framework resource URL", - details: nil)) - return - } - let pythonBundleURL = frameworkBundle.appendingPathComponent("python.bundle") - guard let pythonBundle = Bundle(url: pythonBundleURL), - let resourcePath = pythonBundle.resourcePath else { - result(FlutterError(code: "PYTHON_BUNDLE_ERROR", - message: "Failed to load python.bundle", - details: pythonBundleURL.path)) - return - } - result(resourcePath) + // Dart calls this to discover the stdlib / site-packages / app layout + // before invoking `serious_python_run`. The two build systems put the + // trees in different bundles: + #if SWIFT_PACKAGE + // SwiftPM: staged as `.copy` resources into Bundle.module, whose + // resourcePath contains stdlib/ site-packages/ app/ directly. + guard let resourcePath = Bundle.module.resourcePath else { + result(FlutterError(code: "PYTHON_BUNDLE_ERROR", + message: "Failed to resolve Bundle.module resourcePath", + details: nil)) + return + } + result(resourcePath) + #else + // CocoaPods: the python.bundle that prepare_{ios,macos}.sh assembles + // lives inside the plugin framework as a Resources subbundle. + guard let frameworkBundle = Bundle(for: type(of: self)).resourceURL else { + result(FlutterError(code: "FRAMEWORK_BUNDLE_ERROR", + message: "Failed to get framework resource URL", + details: nil)) + return + } + let pythonBundleURL = frameworkBundle.appendingPathComponent("python.bundle") + guard let pythonBundle = Bundle(url: pythonBundleURL), + let resourcePath = pythonBundle.resourcePath else { + result(FlutterError(code: "PYTHON_BUNDLE_ERROR", + message: "Failed to load python.bundle", + details: pythonBundleURL.path)) + return + } + result(resourcePath) + #endif default: result(FlutterMethodNotImplemented) diff --git a/src/serious_python_darwin/darwin/stage_spm.sh b/src/serious_python_darwin/darwin/stage_spm.sh new file mode 100755 index 00000000..0ebba398 --- /dev/null +++ b/src/serious_python_darwin/darwin/stage_spm.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail +# +# stage_spm.sh +# +# Host-side staging for the Swift Package Manager build path. Maps the assembled +# dist_ tree (produced by prepare_.sh + sync_site_packages.sh) +# into the SPM plugin layout under serious_python_darwin/, which Package.swift +# consumes as local-path binaryTargets + .copy resources. Prints the cache-bust +# key (SP_NATIVE_SET) on stdout — the caller exports it into the `flutter build` +# environment so SwiftPM re-resolves when the staged native set changes. +# +platform=${1:?usage: stage_spm.sh } +script_dir=$(cd "$(dirname "$0")" && pwd -P) +dist="$script_dir/dist_$platform" +pkg="$script_dir/serious_python_darwin" +res="$pkg/Sources/serious_python_darwin/Resources" + +[ -d "$dist" ] || { echo "stage_spm: $dist not found" >&2; exit 1; } + +# 1. Python runtime (dynamic framework -> embedded). Platform-specific path so a +# single shared manifest can carry both via platform-conditional binaryTargets. +rm -rf "$pkg/Python-$platform.xcframework" +cp -R "$dist/xcframeworks/Python.xcframework" "$pkg/Python-$platform.xcframework" + +# 2. dart_bridge (static, version-independent; same artifact in either dist). +rm -rf "$pkg/dart_bridge.xcframework" +cp -R "$dist/xcframeworks/dart_bridge.xcframework" "$pkg/dart_bridge.xcframework" + +# 3. iOS native C-extensions (stdlib lib-dynload + site-packages) -> enumerated +# binaryTargets. macOS has none: its .so's load flat from the resource trees. +rm -rf "$pkg/extra-xcframeworks" +if [ "$platform" = "ios" ] && [ -d "$dist/site-xcframeworks" ]; then + mkdir -p "$pkg/extra-xcframeworks" + cp -R "$dist"/site-xcframeworks/*.xcframework "$pkg/extra-xcframeworks/" 2>/dev/null || true +fi + +# 4. Resource trees (verbatim via rsync). Wipe prior content but keep the +# committed .keep placeholder so the path stays valid in a clean checkout. +for tree in stdlib site-packages app; do + dest="$res/$tree" + mkdir -p "$dest" + find "$dest" -mindepth 1 -not -name '.keep' -delete 2>/dev/null || true + [ -d "$dist/$tree" ] && rsync -a --exclude '.pod' "$dist/$tree/" "$dest/" +done + +# 5. Cache-bust key: platform + Python version + the staged native/resource set +# (path+size). Changes whenever requirements, app, or Python version change. +key_paths=("Python-$platform.xcframework" "Sources/serious_python_darwin/Resources") +[ -d "$pkg/extra-xcframeworks" ] && key_paths+=("extra-xcframeworks") +key=$( + { + echo "$platform ${SERIOUS_PYTHON_FULL_VERSION:-}" + ( cd "$pkg" && find "${key_paths[@]}" -type f -exec stat -f '%N %z' {} + \ + 2>/dev/null | sort ) + } | shasum -a 256 | cut -d' ' -f1 +) +echo "$key" diff --git a/src/serious_python_darwin/darwin/sync_site_packages.sh b/src/serious_python_darwin/darwin/sync_site_packages.sh index 82d99374..5ca55ea9 100755 --- a/src/serious_python_darwin/darwin/sync_site_packages.sh +++ b/src/serious_python_darwin/darwin/sync_site_packages.sh @@ -1,5 +1,19 @@ script_dir=$(cd "$(dirname "$0")" && pwd -P) +# App sources are arch- and platform-independent; stage them as a bare `app/` +# resource bundle into BOTH dist trees, regardless of whether site-packages +# exist (an app may have no pip dependencies). The per-target resource bundle +# (dist_ios / dist_macos) picks the right one at build time. This MUST run +# outside the SERIOUS_PYTHON_SITE_PACKAGES guard below — otherwise a +# dependency-free app never gets bundled and the runtime can't find main.py. +if [[ -n "$SERIOUS_PYTHON_APP" && -d "$SERIOUS_PYTHON_APP" ]]; then + for app_dist in "$script_dir/dist_ios" "$script_dir/dist_macos"; do + rm -rf "$app_dist/app" + mkdir -p "$app_dist/app" + rsync -a --exclude '.pod' "$SERIOUS_PYTHON_APP/" "$app_dist/app/" + done +fi + if [[ -n "$SERIOUS_PYTHON_SITE_PACKAGES" && -d "$SERIOUS_PYTHON_SITE_PACKAGES" ]]; then if [[ -d "$SERIOUS_PYTHON_SITE_PACKAGES/iphoneos.arm64" && -d "$SERIOUS_PYTHON_SITE_PACKAGES/iphonesimulator.arm64" && -d "$SERIOUS_PYTHON_SITE_PACKAGES/iphonesimulator.x86_64" ]]; then @@ -54,6 +68,4 @@ if [[ -n "$SERIOUS_PYTHON_SITE_PACKAGES" && -d "$SERIOUS_PYTHON_SITE_PACKAGES" ] # time to invoke this sync script; it does not belong in the bundle. rsync -av --delete --exclude '.pod' "$SERIOUS_PYTHON_SITE_PACKAGES/" "$dist/site-packages/" fi -else - echo "SERIOUS_PYTHON_SITE_PACKAGES is not set." -fi \ No newline at end of file +fi diff --git a/src/serious_python_darwin/lib/serious_python_darwin.dart b/src/serious_python_darwin/lib/serious_python_darwin.dart index bc68da36..4e8cb76f 100644 --- a/src/serious_python_darwin/lib/serious_python_darwin.dart +++ b/src/serious_python_darwin/lib/serious_python_darwin.dart @@ -17,6 +17,20 @@ class SeriousPythonDarwin extends SeriousPythonPlatform { SeriousPythonPlatform.instance = SeriousPythonDarwin(); } + /// The app ships unpacked inside the `python.bundle` resource at + /// `/app` (placed by the darwin podspec `resource_bundles`, + /// next to `stdlib` + `site-packages`). + @override + Future prepareApp() async { + final resourcePath = + await methodChannel.invokeMethod('getResourcePath'); + if (resourcePath == null) { + throw StateError( + 'serious_python: failed to resolve plugin resource path'); + } + return p.join(resourcePath, 'app'); + } + @override Future run(String appPath, {String? script, diff --git a/src/serious_python_darwin/pubspec.yaml b/src/serious_python_darwin/pubspec.yaml index 0252505e..8c2e09ee 100644 --- a/src/serious_python_darwin/pubspec.yaml +++ b/src/serious_python_darwin/pubspec.yaml @@ -2,9 +2,13 @@ name: serious_python_darwin description: iOS and macOS implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 3.0.0 +version: 4.0.0 environment: + # The Swift Package Manager build path needs Flutter 3.44 / Dart 3.11 (the + # FlutterFramework SwiftPM convention), but `Package.swift` is simply ignored on + # older Flutter — which uses the CocoaPods path instead — so SPM support does + # not raise the plugin's minimum. Keep the existing floor. sdk: ">=3.0.0 <4.0.0" flutter: ">=3.7.0" diff --git a/src/serious_python_linux/CHANGELOG.md b/src/serious_python_linux/CHANGELOG.md index d1341a8e..4592a1b7 100644 --- a/src/serious_python_linux/CHANGELOG.md +++ b/src/serious_python_linux/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.0 + +* `prepareApp()` returns `/app`; the app's Python sources ship unpacked next to the bundled stdlib + site-packages (no first-launch extraction). The CMakeLists copies `SERIOUS_PYTHON_APP` into the bundle. +* Version bump aligning with the `serious_python_*` 4.0.0 release. + ## 3.0.0 * **In-process Python (dart_bridge FFI).** The Python lifecycle is absorbed into `libdart_bridge.so` (from `flet-dev/dart-bridge` **1.4.0**, `DT_RPATH $ORIGIN`) instead of a socket transport. diff --git a/src/serious_python_linux/lib/serious_python_linux.dart b/src/serious_python_linux/lib/serious_python_linux.dart index fee2ac94..0c2a39cc 100644 --- a/src/serious_python_linux/lib/serious_python_linux.dart +++ b/src/serious_python_linux/lib/serious_python_linux.dart @@ -22,6 +22,13 @@ class SeriousPythonLinux extends SeriousPythonPlatform { SeriousPythonPlatform.instance = SeriousPythonLinux(); } + /// The app ships unpacked inside the bundle at `/app` (placed by the + /// Linux CMakeLists, next to the `python3.` stdlib + `site-packages`). + @override + Future prepareApp() async { + return p.join(p.dirname(Platform.resolvedExecutable), 'app'); + } + @override Future run(String appPath, {String? script, diff --git a/src/serious_python_linux/linux/CMakeLists.txt b/src/serious_python_linux/linux/CMakeLists.txt index a7e27c3d..96951110 100644 --- a/src/serious_python_linux/linux/CMakeLists.txt +++ b/src/serious_python_linux/linux/CMakeLists.txt @@ -57,7 +57,10 @@ if(DEFINED ENV{FLET_CACHE_DIR}) else() set(FLET_CACHE_DIR "$ENV{HOME}/.flet/cache") endif() -set(PB_CACHE "${FLET_CACHE_DIR}/python-build/v${PYTHON_FULL_VERSION}") +# Date-keyed so a same-version re-release (new build date) re-downloads instead +# of being served stale from a previous release's cache. dart-bridge stays +# version-keyed (its re-releases bump the version). +set(PB_CACHE "${FLET_CACHE_DIR}/python-build/v${PYTHON_FULL_VERSION}-${PYTHON_BUILD_DATE}") set(DB_CACHE "${FLET_CACHE_DIR}/dart-bridge/v${DART_BRIDGE_VERSION}") file(MAKE_DIRECTORY "${PB_CACHE}" "${DB_CACHE}") @@ -90,8 +93,23 @@ set(PYTHON_PACKAGE ${CMAKE_BINARY_DIR}/python) set(PYTHON_URL https://github.com/flet-dev/python-build/releases/download/${PYTHON_BUILD_DATE}/python-linux-dart-${PYTHON_FULL_VERSION}-${PYTHON_ARCH}.tar.gz) set(PYTHON_FILE "${PB_CACHE}/python-linux-dart-${PYTHON_FULL_VERSION}-${PYTHON_ARCH}.tar.gz") _sp_download("${PYTHON_URL}" "${PYTHON_FILE}") -if(NOT EXISTS "${PYTHON_PACKAGE}/lib/libpython3.so") +# Re-extract when the tree is missing OR was unpacked for a different +# version/release (a marker keyed to version + build date), so a same-version +# re-release replaces it instead of being skipped. +set(_py_build_id "${PYTHON_FULL_VERSION}-${PYTHON_BUILD_DATE}") +set(_py_marker "${PYTHON_PACKAGE}/.python_build_id") +set(_py_extract TRUE) +if(EXISTS "${_py_marker}") + file(READ "${_py_marker}" _py_cur) + string(STRIP "${_py_cur}" _py_cur) + if(_py_cur STREQUAL "${_py_build_id}") + set(_py_extract FALSE) + endif() +endif() +if(_py_extract) + file(REMOVE_RECURSE "${PYTHON_PACKAGE}") file(ARCHIVE_EXTRACT INPUT "${PYTHON_FILE}" DESTINATION "${PYTHON_PACKAGE}") + file(WRITE "${_py_marker}" "${_py_build_id}") endif() # ---- dart_bridge prebuilt .so --------------------------------------------- @@ -166,3 +184,14 @@ if(DEFINED ENV{SERIOUS_PYTHON_SITE_PACKAGES} AND EXISTS "$ENV{SERIOUS_PYTHON_SIT file(COPY \"$ENV{SERIOUS_PYTHON_SITE_PACKAGES}/\" DESTINATION \"${CMAKE_BINARY_DIR}/bundle/site-packages\") ") endif() + +# The app's Python sources (staged unpacked by serious_python's `package` +# command) are bundled as a bare `app/` dir next to the stdlib + site-packages; +# the runtime adds `/app` to sys.path (no extraction at launch). +if(DEFINED ENV{SERIOUS_PYTHON_APP} AND EXISTS "$ENV{SERIOUS_PYTHON_APP}") + install(CODE " + file(REMOVE_RECURSE \"${CMAKE_BINARY_DIR}/bundle/app\") + file(MAKE_DIRECTORY \"${CMAKE_BINARY_DIR}/bundle/app\") + file(COPY \"$ENV{SERIOUS_PYTHON_APP}/\" DESTINATION \"${CMAKE_BINARY_DIR}/bundle/app\") + ") +endif() diff --git a/src/serious_python_linux/linux/python_versions.properties b/src/serious_python_linux/linux/python_versions.properties index 2fc624e2..41d4ec16 100644 --- a/src/serious_python_linux/linux/python_versions.properties +++ b/src/serious_python_linux/linux/python_versions.properties @@ -1,8 +1,8 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260618). Do not edit by hand. +# python-build manifest.json (release 20260621). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260618 +python_build_release_date=20260621 3.12.full_version=3.12.13 3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 diff --git a/src/serious_python_linux/pubspec.yaml b/src/serious_python_linux/pubspec.yaml index 9650b97d..008cc136 100644 --- a/src/serious_python_linux/pubspec.yaml +++ b/src/serious_python_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_linux description: Linux implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 3.0.0 +version: 4.0.0 environment: sdk: '>=3.1.3 <4.0.0' diff --git a/src/serious_python_platform_interface/CHANGELOG.md b/src/serious_python_platform_interface/CHANGELOG.md index c5982886..9c171132 100644 --- a/src/serious_python_platform_interface/CHANGELOG.md +++ b/src/serious_python_platform_interface/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.0.0 + +* Add `prepareApp()` to `SeriousPythonPlatform` — materializes the packaged app on disk (if needed) and returns the directory containing its entry point. +* Remove the runtime zip-extraction helpers (`extractAssetZip` / `extractFileZip` / `extractAssetOrFile` / `extractAsset`); apps now ship unpacked in the bundle (or, on Android, as a stored asset unpacked by the platform plugin). `getDirFiles` is retained. +* Version bump aligning with the `serious_python_*` 4.0.0 release (app files unpacked in the bundle). + ## 3.0.0 * Remove the scaffold `getPlatformVersion` method from the platform interface and its method-channel implementation. diff --git a/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart b/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart index 4c0a78f5..a4bdbea1 100644 --- a/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart +++ b/src/serious_python_platform_interface/lib/serious_python_platform_interface.dart @@ -26,6 +26,17 @@ abstract class SeriousPythonPlatform extends PlatformInterface { _instance = instance; } + /// Materializes the packaged app on disk (if needed) and returns the + /// directory that contains its entry point (`main.pyc` / `main.py`). + /// + /// On desktop/iOS the app ships unpacked inside the application bundle, so + /// this is a pure path lookup. On Android the app ships as a stored + /// `app.zip` asset inside the APK and is unpacked once (version-keyed) to a + /// writable files-dir location on the first launch after an install/update. + Future prepareApp() { + throw UnimplementedError('prepareApp() has not been implemented.'); + } + Future run(String appPath, {String? script, List? modulePaths, diff --git a/src/serious_python_platform_interface/lib/src/utils.dart b/src/serious_python_platform_interface/lib/src/utils.dart index c5555dd4..a3326652 100644 --- a/src/serious_python_platform_interface/lib/src/utils.dart +++ b/src/serious_python_platform_interface/lib/src/utils.dart @@ -1,158 +1,9 @@ import 'dart:io'; -import 'package:archive/archive_io.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; -import 'package:path/path.dart' as p; -import 'package:path_provider/path_provider.dart'; - -Future extractAssetOrFile(String path, - {bool isAsset = true, - String? targetPath, - bool checkHash = false, - String? invalidateKey}) async { - WidgetsFlutterBinding.ensureInitialized(); - final supportDir = await getApplicationSupportDirectory(); - final destDir = - Directory(p.join(supportDir.path, "flet", targetPath ?? p.dirname(path))); - - var invalidateFile = File(p.join(destDir.path, ".invalidate")); - String existingInvalidateKey = ""; - - String assetHash = ""; - // read asset hash from asset - try { - assetHash = (await rootBundle.loadString("$path.hash")).trim(); - // ignore: empty_catches - } catch (e) {} - - String destHash = ""; - var hashFile = File(p.join(destDir.path, ".hash")); - - // re-create dir - if (await destDir.exists()) { - if (kDebugMode) { - // always re-create in debug mode - await destDir.delete(recursive: true); - } else { - var shouldDelete = false; - - if (invalidateKey != null) { - if (await invalidateFile.exists()) { - existingInvalidateKey = - (await invalidateFile.readAsString()).trim(); - } - if (existingInvalidateKey != invalidateKey) { - shouldDelete = true; - } - } - - if (!shouldDelete) { - if (checkHash) { - if (await hashFile.exists()) { - destHash = (await hashFile.readAsString()).trim(); - } - } - - if (assetHash != destHash || - (checkHash && assetHash == "" && destHash == "")) { - shouldDelete = true; - } else { - debugPrint("Application archive already unpacked to ${destDir.path}"); - return destDir.path; - } - } - - if (shouldDelete) { - await destDir.delete(recursive: true); - } - } - } - - debugPrint("extractAssetOrFile directory: ${destDir.path}"); - await destDir.create(recursive: true); - - // unpack from asset or file - debugPrint("Start unpacking archive: $path"); - Stopwatch stopwatch = Stopwatch()..start(); - - try { - Archive archive; - if (isAsset) { - final bytes = await rootBundle.load(path); - var data = bytes.buffer.asUint8List(); - archive = ZipDecoder().decodeBytes(data); - } else { - final inputStream = InputFileStream(path); - archive = ZipDecoder().decodeStream(inputStream); - } - await extractArchiveToDisk(archive, destDir.path); - } catch (e) { - debugPrint("Error unpacking archive: $e"); - await destDir.delete(recursive: true); - rethrow; - } - - debugPrint("Finished unpacking application archive in ${stopwatch.elapsed}"); - - if (checkHash) { - debugPrint("Writing hash file: ${hashFile.path}, hash: $assetHash"); - await hashFile.writeAsString(assetHash); - } - - if (invalidateKey != null) { - debugPrint( - "Writing invalidate file: ${invalidateFile.path}, key: $invalidateKey"); - await invalidateFile.writeAsString(invalidateKey); - } - - return destDir.path; -} - -Future extractAssetZip(String assetPath, - {String? targetPath, - bool checkHash = false, - String? invalidateKey}) async { - return extractAssetOrFile(assetPath, - targetPath: targetPath, - checkHash: checkHash, - invalidateKey: invalidateKey); -} - -Future extractFileZip(String filePath, - {String? targetPath, - bool checkHash = false, - String? invalidateKey}) async { - return extractAssetOrFile(filePath, - isAsset: false, - targetPath: targetPath, - checkHash: checkHash, - invalidateKey: invalidateKey); -} - -Future extractAsset(String assetPath) async { - WidgetsFlutterBinding.ensureInitialized(); - - // (re-)create destination directory - final supportDir = await getApplicationSupportDirectory(); - final destDir = - Directory(p.join(supportDir.path, "flet", p.dirname(assetPath))); - - await destDir.create(recursive: true); - - // extract file from assets - var destPath = p.join(destDir.path, p.basename(assetPath)); - if (kDebugMode && await File(destPath).exists()) { - await File(destPath).delete(); - } - ByteData data = await rootBundle.load(assetPath); - List bytes = - data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); - await File(destPath).writeAsBytes(bytes); - return destPath; -} - +/// Lists the files under [path] (optionally [recursive]ly), one per line. +/// +/// Small debug helper used to inspect bundled/unpacked directories. Returns +/// `""` if the directory does not exist. Future getDirFiles(String path, {bool recursive = false}) async { final dir = Directory(path); if (!await dir.exists()) { diff --git a/src/serious_python_platform_interface/pubspec.yaml b/src/serious_python_platform_interface/pubspec.yaml index 0496dbda..6d8c433d 100644 --- a/src/serious_python_platform_interface/pubspec.yaml +++ b/src/serious_python_platform_interface/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_platform_interface description: A common platform interface for the serious_python plugin. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 3.0.0 +version: 4.0.0 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_windows/CHANGELOG.md b/src/serious_python_windows/CHANGELOG.md index 69db9e85..13c9482f 100644 --- a/src/serious_python_windows/CHANGELOG.md +++ b/src/serious_python_windows/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.0 + +* `prepareApp()` returns `/app`; the app's Python sources ship unpacked next to the bundled CPython `Lib`/`DLLs`/`site-packages` (no first-launch extraction). The CMakeLists copies `SERIOUS_PYTHON_APP` into the runner output. +* Version bump aligning with the `serious_python_*` 4.0.0 release. + ## 3.0.0 * **In-process Python (dart_bridge FFI).** The Python lifecycle is absorbed into `dart_bridge.dll` / `dart_bridge.pyd` (from `flet-dev/dart-bridge` **1.4.0**) instead of a socket transport; both Release and Debug `dart_bridge.pyd` ship so 3.13/3.14 Debug builds resolve too. diff --git a/src/serious_python_windows/lib/serious_python_windows.dart b/src/serious_python_windows/lib/serious_python_windows.dart index a7553bb2..de0a6a8a 100644 --- a/src/serious_python_windows/lib/serious_python_windows.dart +++ b/src/serious_python_windows/lib/serious_python_windows.dart @@ -19,6 +19,13 @@ class SeriousPythonWindows extends SeriousPythonPlatform { SeriousPythonPlatform.instance = SeriousPythonWindows(); } + /// The app ships unpacked inside the bundle at `/app` (placed by the + /// Windows CMakeLists, next to the bundled CPython `Lib`/`DLLs`/`site-packages`). + @override + Future prepareApp() async { + return p.join(p.dirname(Platform.resolvedExecutable), 'app'); + } + @override Future run(String appPath, {String? script, diff --git a/src/serious_python_windows/pubspec.yaml b/src/serious_python_windows/pubspec.yaml index 0d44c07b..820c6b3e 100644 --- a/src/serious_python_windows/pubspec.yaml +++ b/src/serious_python_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_windows description: Windows implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 3.0.0 +version: 4.0.0 environment: sdk: '>=3.1.3 <4.0.0' diff --git a/src/serious_python_windows/windows/CMakeLists.txt b/src/serious_python_windows/windows/CMakeLists.txt index 274b83d4..573388c6 100644 --- a/src/serious_python_windows/windows/CMakeLists.txt +++ b/src/serious_python_windows/windows/CMakeLists.txt @@ -60,7 +60,10 @@ elseif(DEFINED ENV{USERPROFILE}) else() set(FLET_CACHE_DIR "$ENV{HOME}/.flet/cache") endif() -set(PB_CACHE "${FLET_CACHE_DIR}/python-build/v${PYTHON_FULL_VERSION}") +# Date-keyed so a same-version re-release (new build date) re-downloads instead +# of being served stale from a previous release's cache. dart-bridge stays +# version-keyed (its re-releases bump the version). +set(PB_CACHE "${FLET_CACHE_DIR}/python-build/v${PYTHON_FULL_VERSION}-${PYTHON_BUILD_DATE}") set(DB_CACHE "${FLET_CACHE_DIR}/dart-bridge/v${DART_BRIDGE_VERSION}") file(MAKE_DIRECTORY "${PB_CACHE}" "${DB_CACHE}") @@ -102,8 +105,23 @@ function(_sp_download url dest) endfunction() _sp_download("${PYTHON_URL}" "${PYTHON_FILE}") -if(NOT EXISTS "${PYTHON_PACKAGE}/python.exe") +# Re-extract when the tree is missing OR was unpacked for a different +# version/release (a marker keyed to version + build date), so a same-version +# re-release replaces it instead of being skipped. +set(_py_build_id "${PYTHON_FULL_VERSION}-${PYTHON_BUILD_DATE}") +set(_py_marker "${PYTHON_PACKAGE}/.python_build_id") +set(_py_extract TRUE) +if(EXISTS "${_py_marker}") + file(READ "${_py_marker}" _py_cur) + string(STRIP "${_py_cur}" _py_cur) + if(_py_cur STREQUAL "${_py_build_id}") + set(_py_extract FALSE) + endif() +endif() +if(_py_extract) + file(REMOVE_RECURSE "${PYTHON_PACKAGE}") file(ARCHIVE_EXTRACT INPUT "${PYTHON_FILE}" DESTINATION "${PYTHON_PACKAGE}") + file(WRITE "${_py_marker}" "${_py_build_id}") endif() # ---- dart_bridge prebuilt DLLs -------------------------------------------- @@ -216,3 +234,16 @@ if(DEFINED ENV{SERIOUS_PYTHON_SITE_PACKAGES} AND EXISTS "$ENV{SERIOUS_PYTHON_SIT "${SP_RUNNER_OUT}/site-packages" ) endif() + +# The app's Python sources (staged unpacked by serious_python's `package` +# command) ship as a bare `app/` dir next to the bundled CPython Lib/DLLs/ +# site-packages; the runtime adds `/app` to sys.path (no extraction). +if(DEFINED ENV{SERIOUS_PYTHON_APP} AND EXISTS "$ENV{SERIOUS_PYTHON_APP}") + add_custom_command(TARGET CopyPythonDLLs POST_BUILD + COMMAND ${CMAKE_COMMAND} -E rm -rf "${SP_RUNNER_OUT}/app" + COMMAND ${CMAKE_COMMAND} -E make_directory "${SP_RUNNER_OUT}/app" + COMMAND ${CMAKE_COMMAND} -E copy_directory + "$ENV{SERIOUS_PYTHON_APP}" + "${SP_RUNNER_OUT}/app" + ) +endif() diff --git a/src/serious_python_windows/windows/python_versions.properties b/src/serious_python_windows/windows/python_versions.properties index 2fc624e2..41d4ec16 100644 --- a/src/serious_python_windows/windows/python_versions.properties +++ b/src/serious_python_windows/windows/python_versions.properties @@ -1,8 +1,8 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260618). Do not edit by hand. +# python-build manifest.json (release 20260621). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260618 +python_build_release_date=20260621 3.12.full_version=3.12.13 3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14