flutter.buildFlutterApplication: Use extraPackageConfigSetup
This commit is contained in:
parent
7e043f5f28
commit
af6e82b47a
1 changed files with 11 additions and 9 deletions
|
@ -68,6 +68,17 @@
|
|||
'';
|
||||
};
|
||||
|
||||
extraPackageConfigSetup = ''
|
||||
# https://github.com/flutter/flutter/blob/3.13.8/packages/flutter_tools/lib/src/dart/pub.dart#L755
|
||||
if [ "$(yq '.flutter.generate // false' pubspec.yaml)" = "true" ]; then
|
||||
jq '.packages |= . + [{
|
||||
name: "flutter_gen",
|
||||
rootUri: "flutter_gen",
|
||||
languageVersion: "2.12",
|
||||
}]' "$out" | '${moreutils}/bin/sponge' "$out"
|
||||
fi
|
||||
'';
|
||||
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ wrapGAppsHook jq yq moreutils ];
|
||||
buildInputs = (args.buildInputs or [ ]) ++ [ glib ];
|
||||
|
||||
|
@ -77,15 +88,6 @@
|
|||
|
||||
mkdir -p build/flutter_assets/fonts
|
||||
|
||||
# https://github.com/flutter/flutter/blob/3.13.8/packages/flutter_tools/lib/src/dart/pub.dart#L755
|
||||
if [ "$(yq '.flutter.generate // false' pubspec.yaml)" = "true" ]; then
|
||||
jq '.packages |= . + [{
|
||||
name: "flutter_gen",
|
||||
rootUri: "flutter_gen",
|
||||
languageVersion: "2.12",
|
||||
}]' .dart_tool/package_config.json | sponge .dart_tool/package_config.json
|
||||
fi
|
||||
|
||||
flutter build linux -v --release --split-debug-info="$debug" ${builtins.concatStringsSep " " (map (flag: "\"${flag}\"") flutterBuildFlags)}
|
||||
|
||||
runHook postBuild
|
||||
|
|
Loading…
Reference in a new issue