Skip to content

Commit 4a73303

Browse files
Federated plugin (#26)
* Initial check-in of federated plugin * Patch pubspec * Fix yaml * Update patch_pubspec.py * patch on publish only * Some cleanup * change publishing order * examples deps updated * Bump ios/android deps to 0.3.0
1 parent 1743451 commit 4a73303

File tree

202 files changed

+2770
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2770
-223
lines changed

.appveyor.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ for:
147147
- job_name: Publish serious_python package to pub.dev
148148

149149
install:
150+
# update build version
151+
- ps: |
152+
if ($env:APPVEYOR_REPO_TAG_NAME) {
153+
$env:PKG_VER = $env:APPVEYOR_REPO_TAG_NAME.replace("v", "")
154+
} else {
155+
$cv = [version](git describe --abbrev=0).substring(1)
156+
$env:PKG_VER = "$($cv.major).$($cv.minor).$($env:APPVEYOR_BUILD_NUMBER)"
157+
}
158+
Write-Host "Package version: $($env:PKG_VER)"
159+
160+
- pip3 install pyyaml
150161
- flutter upgrade --force
151162

152163
build_script:
@@ -155,9 +166,49 @@ for:
155166
if [[ "$APPVEYOR_REPO_TAG_NAME" != "" ]]; then
156167
mkdir -p $HOME/.config/dart
157168
echo $PUB_DEV_TOKEN | base64 --decode > $HOME/.config/dart/pub-credentials.json
169+
170+
# patch pubspecs
171+
python3 ci/patch_pubspec.py src/serious_python_platform_interface/pubspec.yaml $PKG_VER
172+
python3 ci/patch_pubspec.py src/serious_python/pubspec.yaml $PKG_VER
173+
python3 ci/patch_pubspec.py src/serious_python_android/pubspec.yaml $PKG_VER
174+
python3 ci/patch_pubspec.py src/serious_python_ios/pubspec.yaml $PKG_VER
175+
#python3 ci/patch_pubspec.py src/serious_python_windows/pubspec.yaml $PKG_VER
176+
#python3 ci/patch_pubspec.py src/serious_python_linux/pubspec.yaml $PKG_VER
177+
#python3 ci/patch_pubspec.py src/serious_python_macos/pubspec.yaml $PKG_VER
178+
179+
pushd src/serious_python_platform_interface
158180
dart pub publish --force
181+
popd
182+
183+
pushd src/serious_python_android
184+
dart pub publish --force
185+
popd
186+
187+
pushd src/serious_python_ios
188+
dart pub publish --force
189+
popd
190+
191+
pushd src/serious_python
192+
dart pub publish --force
193+
popd
194+
159195
elif [[ "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then
196+
197+
pushd src/serious_python_platform_interface
198+
dart pub publish --dry-run
199+
popd
200+
201+
pushd src/serious_python_android
202+
dart pub publish --dry-run
203+
popd
204+
205+
pushd src/serious_python_ios
206+
dart pub publish --dry-run
207+
popd
208+
209+
pushd src/serious_python
160210
dart pub publish --dry-run
211+
popd
161212
fi
162213
163214
test: off

.metadata

Lines changed: 0 additions & 33 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Bump version in:
66

77
* `pubspec.yaml`
8-
* `android/build.gradle`
9-
* `ios/serious_python.podspec`
8+
* `src/serious_python_android/android/build.gradle`
9+
* `src/serious_python_ios/ios/serious_python_ios.podspec`
1010

1111
Bump `serious_python` dependency version with `flutter pub get` in example lock files:
1212

13-
* `example/flet_example/pubspec.lock`
14-
* `example/flask_example/pubspec.lock`
13+
* `src/serious_python/example/flet_example/pubspec.lock`
14+
* `src/serious_python/example/flask_example/pubspec.lock`
1515

1616
Update `CHANGELOG.md`.
1717

android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/patch_pubspec.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import pathlib
3+
import sys
4+
5+
import yaml
6+
7+
if len(sys.argv) < 3:
8+
print("Specify pubspec.yaml file and version to patch")
9+
sys.exit(1)
10+
11+
current_dir = pathlib.Path(os.getcwd())
12+
pubspec_path = current_dir.joinpath(current_dir, sys.argv[1])
13+
ver = sys.argv[2]
14+
print(f"Patching pubspec.yaml file {pubspec_path} with {ver}")
15+
16+
dependencies = [
17+
"serious_python_platform_interface",
18+
"serious_python_android",
19+
"serious_python_ios",
20+
"serious_python_windows",
21+
"serious_python_linux",
22+
"serious_python_macos",
23+
]
24+
25+
with open(pubspec_path, "r") as f:
26+
data = yaml.safe_load(f)
27+
28+
# patch version
29+
data["version"] = ver
30+
31+
# patch dependencies
32+
for dep in data["dependencies"]:
33+
if dep in dependencies:
34+
data["dependencies"][dep] = ver
35+
# print(dep)
36+
with open(pubspec_path, "w") as file:
37+
yaml.dump(data, file, sort_keys=False)

pubspec.yaml

Lines changed: 0 additions & 67 deletions
This file was deleted.

CHANGELOG.md renamed to src/serious_python/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.0
2+
3+
* `serious_python` all-in-one package refactored to a federated plug-in with multiple endorsed packages.
4+
15
## 0.2.4
26

37
* Fix _Py_HashRandomization_Init error on Windows.

0 commit comments

Comments
 (0)