Skip to content

Commit 8b8acf0

Browse files
committed
Supports custom FLUTTER_ROOT environment variable.
1 parent 4c7ce87 commit 8b8acf0

Some content is hidden

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

50 files changed

+220
-102
lines changed

README-ZH.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dart pub global activate flutter_distributor
6262
`distribute_options.yaml` 添加到你的项目根目录。
6363

6464
```yaml
65-
env:
65+
variables:
6666
PGYER_API_KEY: "your api key"
6767
output: dist/
6868
releases:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dart pub global activate flutter_distributor
6262
Add `distribute_options.yaml` to your project root directory.
6363

6464
```yaml
65-
env:
65+
variables:
6666
PGYER_API_KEY: "your api key"
6767
output: dist/
6868
releases:

docs/en/distribute-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Distribute Options
55
## Example
66

77
```yaml
8-
env:
8+
variables:
99
PGYER_API_KEY: "your api key"
1010
output: dist/
1111
releases:

docs/en/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ output: dist/
2424
Let's take `pgyer` as an example, after logging in, click the user avatar on the right side to go to the [API information](https://www.pgyer.com/account/api) page from the menu, copy the `API Key` and add it to the env node.
2525

2626
```yaml
27-
env:
27+
variables:
2828
PGYER_API_KEY: "your api key"
2929
```
3030

@@ -67,7 +67,7 @@ releases:
6767
### Full Example Configuration
6868

6969
```yaml
70-
env:
70+
variables:
7171
PGYER_API_KEY: "your api key"
7272
output: dist/
7373
releases:

docs/en/publishers/appcenter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ flutter_distributor publish \
3030
### Configure `distribute_options.yaml`
3131

3232
```yaml
33-
env:
33+
variables:
3434
# See: https://appcenter.ms/settings/apitokens
3535
APPCENTER_API_TOKEN: <api-token>
3636
output: dist/

docs/en/publishers/appstore.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ flutter_distributor publish \
3939
### Configure `distribute_options.yaml`
4040

4141
```yaml
42-
env:
42+
variables:
4343
APPSTORE_USERNAME: "xxx"
4444
APPSTORE_PASSWORD: "xxx"
4545
# or

docs/en/publishers/firebase.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ flutter_distributor publish \
4242
### Configure `distribute_options.yaml`
4343

4444
```yaml
45-
env:
45+
variables:
4646
FIREBASE_TOKEN: your token, See[https://firebase.google.com/docs/cli?authuser=0#cli-ci-systems]
4747
output: dist/
4848
releases:

docs/en/publishers/github.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ flutter_distributor publish \
2929
### Configure `distribute_options.yaml`
3030

3131
```yaml
32-
env:
32+
variables:
3333
GITHUB_TOKEN: your personal access token, See[https://docs.github.com/cn/[email protected]/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token]
3434
output: dist/
3535
releases:

docs/en/publishers/qiniu.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ flutter_distributor publish \
2929
### Configure `distribute_options.yaml`
3030

3131
```yaml
32-
env:
32+
variables:
3333
QINIU_ACCESS_KEY: your access key
3434
QINIU_SECRET_KEY: your secret key
3535
output: dist/

docs/zh/distribute-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: 分发选项
55
## 示例
66

77
```yaml
8-
env:
8+
variables:
99
PGYER_API_KEY: "your api key"
1010
output: dist/
1111
releases:

docs/zh/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ output: dist/
2222
`pgyer` 为例,登录后,点击右侧的用户头像,从菜单中进入[API 信息](https://www.pgyer.com/account/api)页面,复制 `API Key` 并将其添加到 `env` 节点。
2323

2424
```yaml
25-
env:
25+
variables:
2626
PGYER_API_KEY: "your api key"
2727
```
2828

@@ -65,7 +65,7 @@ releases:
6565
### 完整的示例配置
6666

6767
```yaml
68-
env:
68+
variables:
6969
PGYER_API_KEY: "your api key"
7070
output: dist/
7171
releases:

docs/zh/publishers/appcenter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ flutter_distributor publish \
3030
### 配置 `distribute_options.yaml`
3131

3232
```yaml
33-
env:
33+
variables:
3434
# See: https://appcenter.ms/settings/apitokens
3535
APPCENTER_API_TOKEN: <api-token>
3636
output: dist/

docs/zh/publishers/appstore.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ flutter_distributor publish \
3939
### 配置 `distribute_options.yaml`
4040

4141
```yaml
42-
env:
42+
variables:
4343
APPSTORE_USERNAME: "xxx"
4444
APPSTORE_PASSWORD: "xxx"
4545
# or

docs/zh/publishers/firebase.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ flutter_distributor publish \
4242
### 配置 `distribute_options.yaml`
4343

4444
```yaml
45-
env:
45+
variables:
4646
FIREBASE_TOKEN: your token, See[https://firebase.google.com/docs/cli?authuser=0#cli-ci-systems]
4747
output: dist/
4848
releases:

docs/zh/publishers/github.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ flutter_distributor publish \
2929
### 配置 `distribute_options.yaml`
3030

3131
```yaml
32-
env:
32+
variables:
3333
GITHUB_TOKEN: your personal access token, See[https://docs.github.com/cn/[email protected]/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token]
3434
output: dist/
3535
releases:

docs/zh/publishers/qiniu.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ flutter_distributor publish \
2929
### 配置 `distribute_options.yaml`
3030

3131
```yaml
32-
env:
32+
variables:
3333
QINIU_ACCESS_KEY: your access key
3434
QINIU_SECRET_KEY: your secret key
3535
output: dist/

examples/hello_world/distribute_options.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
env:
2-
# PGYER_API_KEY: your api key
31
output: dist/
2+
variables:
3+
FLUTTER_ROOT: ~/fvm/versions/3.10.0
4+
# PGYER_API_KEY: your api key
45
releases:
56
- name: dev-profile
67
jobs:
@@ -77,6 +78,8 @@ releases:
7778
- name: dev-release
7879
jobs:
7980
- name: android-aab
81+
variables:
82+
FLUTTER_ROOT: ~/fvm/versions/3.10.2
8083
package:
8184
platform: android
8285
target: aab

examples/hello_world/ios/Runner.xcodeproj/project.pbxproj

+3-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
0722C86F52094B5AFA9D74C3 /* Pods-Runner.release.xcconfig */,
6969
F420089D2E1AFAF26E3F1A48 /* Pods-Runner.profile.xcconfig */,
7070
);
71-
name = Pods;
7271
path = Pods;
7372
sourceTree = "<group>";
7473
};
@@ -341,7 +340,7 @@
341340
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
342341
CLANG_ENABLE_MODULES = YES;
343342
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
344-
DEVELOPMENT_TEAM = G83H824X6L;
343+
DEVELOPMENT_TEAM = "";
345344
ENABLE_BITCODE = NO;
346345
INFOPLIST_FILE = Runner/Info.plist;
347346
LD_RUNPATH_SEARCH_PATHS = (
@@ -470,7 +469,7 @@
470469
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
471470
CLANG_ENABLE_MODULES = YES;
472471
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
473-
DEVELOPMENT_TEAM = G83H824X6L;
472+
DEVELOPMENT_TEAM = "";
474473
ENABLE_BITCODE = NO;
475474
INFOPLIST_FILE = Runner/Info.plist;
476475
LD_RUNPATH_SEARCH_PATHS = (
@@ -493,7 +492,7 @@
493492
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
494493
CLANG_ENABLE_MODULES = YES;
495494
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
496-
DEVELOPMENT_TEAM = G83H824X6L;
495+
DEVELOPMENT_TEAM = "";
497496
ENABLE_BITCODE = NO;
498497
INFOPLIST_FILE = Runner/Info.plist;
499498
LD_RUNPATH_SEARCH_PATHS = (

examples/hello_world/release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
dart ../../packages/flutter_distributor/bin/main.dart release --name $1 --skip-clean
3+
dart ../../packages/flutter_distributor/bin/main.dart release --name $1 --skip-clean --no-version-check

examples/multiple_flavors/pubspec.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ packages:
140140
dependency: transitive
141141
description:
142142
name: http
143-
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
143+
sha256: "4c3f04bfb64d3efd508d06b41b825542f08122d30bda4933fb95c069d22a4fa3"
144144
url: "https://pub.dev"
145145
source: hosted
146-
version: "0.13.6"
146+
version: "1.0.0"
147147
http_parser:
148148
dependency: transitive
149149
description:
@@ -220,10 +220,10 @@ packages:
220220
dependency: "direct main"
221221
description:
222222
name: package_info_plus
223-
sha256: "28386bbe89ab5a7919a47cea99cdd1128e5a6e0bbd7eaafe20440ead84a15de3"
223+
sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b
224224
url: "https://pub.dev"
225225
source: hosted
226-
version: "4.0.1"
226+
version: "4.0.2"
227227
package_info_plus_platform_interface:
228228
dependency: transitive
229229
description:
@@ -345,10 +345,10 @@ packages:
345345
dependency: transitive
346346
description:
347347
name: win32
348-
sha256: "6ca3aaab1790eeb1f5cad232e33d9c53ba66e884dd3e7686c4e730bffc45f1a3"
348+
sha256: "7dacfda1edcca378031db9905ad7d7bd56b29fd1a90b0908b71a52a12c41e36b"
349349
url: "https://pub.dev"
350350
source: hosted
351-
version: "5.0.2"
351+
version: "5.0.3"
352352
xml:
353353
dependency: transitive
354354
description:

packages/app_package_maker/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.4
2+
3+
* bump `shell_executor` to 0.1.4
4+
15
## 0.3.2
26

37
* Update dart sdk version to ">=2.16.0 <4.0.0"

packages/app_package_maker/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ packages:
143143
path: "../shell_executor"
144144
relative: true
145145
source: path
146-
version: "0.1.3"
146+
version: "0.1.4"
147147
source_span:
148148
dependency: transitive
149149
description:

packages/app_package_maker/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: app_package_maker
22
description: App package maker
3-
version: 0.3.2
3+
version: 0.3.4
44
homepage: https://distributor.leanflutter.org
55
repository: https://github.com/leanflutter/flutter_distributor/tree/main/packages/app_package_maker
66

@@ -11,7 +11,7 @@ dependencies:
1111
mustache_template: ^2.0.0
1212
pub_semver: ^2.1.0
1313
pubspec_parse: ^1.1.0
14-
shell_executor: ^0.1.3
14+
shell_executor: ^0.1.4
1515
yaml: ^3.1.0
1616

1717
dev_dependencies:

packages/app_package_publisher/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.4
2+
3+
* bump `shell_executor` to 0.1.4
4+
15
## 0.3.2
26

37
* Update dart sdk version to ">=2.16.0 <4.0.0"

packages/app_package_publisher/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ packages:
135135
path: "../shell_executor"
136136
relative: true
137137
source: path
138-
version: "0.1.3"
138+
version: "0.1.4"
139139
source_span:
140140
dependency: transitive
141141
description:
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: app_package_publisher
22
description: App package publisher
3-
version: 0.3.2
3+
version: 0.3.4
44
homepage: https://distributor.leanflutter.org
55
repository: https://github.com/leanflutter/flutter_distributor/tree/main/packages/app_package_publisher
66

@@ -9,6 +9,7 @@ environment:
99

1010
dependencies:
1111
pubspec_parse: ^1.1.0
12-
shell_executor: ^0.1.3
12+
shell_executor: ^0.1.4
13+
1314
dev_dependencies:
1415
dependency_validator: ^3.0.0

packages/flutter_app_builder/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.4
2+
3+
* bump `shell_executor` to 0.1.4
4+
15
## 0.3.3
26

37
* [apk-builer] fix apk not found

packages/flutter_app_builder/lib/src/builders/app_builder.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import 'dart:io';
33
import 'package:flutter_app_builder/src/build_config.dart';
44
import 'package:flutter_app_builder/src/build_error.dart';
55
import 'package:flutter_app_builder/src/build_result.dart';
6+
import 'package:flutter_app_builder/src/commands/flutter.dart';
67
import 'package:pub_semver/pub_semver.dart';
78
import 'package:pubspec_parse/pubspec_parse.dart';
8-
import 'package:shell_executor/shell_executor.dart';
99

1010
abstract class AppBuilder {
1111
String get platform => throw UnimplementedError();
@@ -34,6 +34,7 @@ abstract class AppBuilder {
3434

3535
Future<BuildResult> build({
3636
required Map<String, dynamic> arguments,
37+
Map<String, String>? environment,
3738
}) async {
3839
final time = Stopwatch()..start();
3940

@@ -59,9 +60,8 @@ abstract class AppBuilder {
5960
'FLUTTER_BUILD_NUMBER=$appBuildNumber',
6061
]);
6162

62-
ProcessResult processResult = await $(
63-
'flutter',
64-
['build', buildSubcommand, ...buildArguments],
63+
ProcessResult processResult = await flutter.withEnv(environment).build(
64+
[buildSubcommand, ...buildArguments],
6565
);
6666

6767
if (processResult.exitCode != 0) {

packages/flutter_app_builder/lib/src/builders/ios/app_builder_ios.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ class AppBuilderIos extends AppBuilder {
2121
@override
2222
Future<BuildResult> build({
2323
required Map<String, dynamic> arguments,
24+
Map<String, String>? environment,
2425
}) {
2526
if (!arguments.containsKey('export-options-plist') &&
2627
!arguments.containsKey('export-method')) {
2728
throw BuildError(
2829
'Missing `export-options-plist` or `export-method` build argument.',
2930
);
3031
}
31-
return super.build(arguments: arguments);
32+
return super.build(
33+
arguments: arguments,
34+
environment: environment,
35+
);
3236
}
3337
}

0 commit comments

Comments
 (0)