build method
Build the artifact for Windows. It creates a .zip archive.
Implementation
@override
Future<String?> build() async {
var filePath = await flutterBuild.build(buildCmd: 'windows');
final cpuArchitecture = getCpuArchitecture();
if (filePath == null) return null;
filePath = '${path.dirname(filePath)}\\*';
final artifactPath = flutterBuild.getArtifactPath(
platform: 'windows',
arch: cpuArchitecture,
extension: 'zip',
);
await runProcess(
'powershell',
[
'Compress-Archive',
'-Force',
'-Path',
filePath,
'-DestinationPath',
artifactPath.replaceAll('/', '\\'),
],
);
return artifactPath;
}