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

feat(manager/asdf): support channel suffix on asdf-flutter #22131

Merged
merged 5 commits into from May 17, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 24 additions & 1 deletion lib/modules/manager/asdf/extract.spec.ts
Expand Up @@ -60,7 +60,7 @@ ecspresso 2.1.0
elixir 1.14.1
elm 0.19.1
erlang 25.1.2
flutter 3.7.6
flutter 3.7.6-stable
flux2 0.41.2
gauche 0.9.12
gohugo extended_0.104.3
Expand Down Expand Up @@ -516,6 +516,29 @@ dummy 1.2.3
});
});

it('can handle flutter version channel', () => {
const withChannel = extractPackageFile('flutter 3.10.0-stable');
expect(withChannel).toEqual({
deps: [
{
currentValue: '3.10.0',
datasource: 'flutter-version',
depName: 'flutter',
},
],
});
const withoutChannel = extractPackageFile('flutter 3.10.0');
expect(withoutChannel).toEqual({
deps: [
{
currentValue: '3.10.0',
datasource: 'flutter-version',
depName: 'flutter',
},
],
});
});

it('can handle java jre / jdk', () => {
const jdkRes = extractPackageFile('java adoptopenjdk-16.0.0+36');
expect(jdkRes).toEqual({
Expand Down
7 changes: 5 additions & 2 deletions lib/modules/manager/asdf/upgradeable-tooling.ts
@@ -1,3 +1,4 @@
import { regEx } from '../../../util/regex';
import { DartVersionDatasource } from '../../datasource/dart-version';
import { DockerDatasource } from '../../datasource/docker';
import { FlutterVersionDatasource } from '../../datasource/flutter-version';
Expand Down Expand Up @@ -158,9 +159,11 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
},
flutter: {
asdfPluginUrl: 'https://github.com/oae/asdf-flutter',
config: {
config: (version) => ({
datasource: FlutterVersionDatasource.id,
},
// asdf-flutter plugin supports channel on version suffix.
currentValue: version.replace(regEx(/-(stable|beta|dev)$/), ''),
viceice marked this conversation as resolved.
Show resolved Hide resolved
}),
},
flux2: {
asdfPluginUrl: 'https://github.com/tablexi/asdf-flux2.git',
Expand Down