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();
final flutterArch = getFlutterCpuArchitecture(cpuArchitecture);
if (filePath != null) {
filePath = '${path.dirname(filePath)}\\*';
} else {
filePath = 'build\\windows\\$flutterArch\\runner\\Release\\*';
}
final artifactPath = flutterBuild.getArtifactPath(
platform: 'windows',
arch: cpuArchitecture,
extension: 'zip',
);
await runProcess(
'powershell',
[
'Compress-Archive',
'-Force',
'-Path',
filePath,
'-DestinationPath',
artifactPath.replaceAll('/', '\\'),
],
);
return artifactPath;
}