Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: template dartSdkVersionBounds #47

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: check_platform_name
name: check_platform_name
description: A custom action for Fluttium.
version: 0.1.0+1

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

dependencies:
flutter:
Expand All @@ -14,4 +14,4 @@ dev_dependencies:
flutter_test:
sdk: flutter
mocktail: ^1.0.0
very_good_analysis: ^5.1.0
very_good_analysis: ^5.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
publish_to: none

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

{{> plugin_platforms.dart }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
{{^publishable}}publish_to: none{{/publishable}}

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: "{{{dartSdkVersionBounds}}}"

dependencies:
flutter:
Expand Down
9 changes: 6 additions & 3 deletions very_good_flutter_plugin/hooks/pre_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ void run(HookContext context) {

context.logger.info(selectedPlatforms.toString());

for (final platform in availablePlatforms) {
context.vars[platform] = selectedPlatforms.contains(platform);
}
context.vars.addAll({
'dartSdkVersionBounds': '>=3.0.0 <4.0.0',
for (final platform in availablePlatforms)
platform: selectedPlatforms.contains(platform),
});

context.logger.info(context.vars.toString());
}
9 changes: 9 additions & 0 deletions very_good_flutter_plugin/hooks/test/pre_gen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ void main() {
context = _MockHookContext();
});

test('sets dartSdkVersionBounds', () {
final vars = <String, dynamic>{};
when(() => context.vars).thenReturn(vars);

pre_gen.run(context);

expect(vars['dartSdkVersionBounds'], '>=3.0.0 <4.0.0');
});

group('android variable', () {
const androidVariable = 'android';

Expand Down
Loading