출력 스트림으로 나오도록 수정
This commit is contained in:
parent
149b0380ca
commit
851f0d7165
5 changed files with 36 additions and 26 deletions
|
|
@ -3,7 +3,7 @@ common:
|
|||
workspace: "."
|
||||
|
||||
commands:
|
||||
### Version 쓰기
|
||||
### Version <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
- command: CreateAppData
|
||||
param:
|
||||
scm: Git
|
||||
|
|
@ -12,17 +12,13 @@ commands:
|
|||
returnVersion: "<!common.version>"
|
||||
returnHash: "<!common.hash>"
|
||||
|
||||
### 프로젝트 패키지 업데이트
|
||||
- command: BuildDart
|
||||
param: {}
|
||||
|
||||
### 실행가능한 파일로 빌드
|
||||
### <20><><EFBFBD>డ<EFBFBD><E0B0A1><EFBFBD><EFBFBD> <20><><EFBFBD>Ϸ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
- command: BuildDartCompile
|
||||
param:
|
||||
targetDartFile: "./bin/main.dart"
|
||||
buildFileName: oto_cli
|
||||
|
||||
### 최종 zip 파일 형태로 저장
|
||||
### <EFBFBD><EFBFBD><EFBFBD><EFBFBD> zip <20><><EFBFBD><EFBFBD> <20><><EFBFBD>·<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
- command: Zip
|
||||
param:
|
||||
zipFile: "<!common.workspace>/release/oto_win_v<!common.version>.zip"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:dart_framework/platform/process.dart';
|
||||
import 'package:dart_framework/utils/system_util.dart';
|
||||
import 'package:oto_cli/oto/command.dart';
|
||||
import 'package:oto_cli/oto/data/data.dart';
|
||||
|
|
@ -24,6 +25,8 @@ class Application {
|
|||
}
|
||||
|
||||
Future<void> build(BuildType buildType, {String? yamlContent}) async {
|
||||
setKorean();
|
||||
|
||||
Map<String, dynamic>? buildMap;
|
||||
Map<String, dynamic>? jenkinsMap;
|
||||
// var envArgs = envArguments(arguments);
|
||||
|
|
@ -76,6 +79,16 @@ class Application {
|
|||
await execute(buildMap!);
|
||||
}
|
||||
|
||||
Future setKorean() async {
|
||||
if (Platform.isWindows) {
|
||||
var data = await ProcessExecutor.start(
|
||||
StringBuffer('C:\\Windows\\System32\\chcp.com 65001'));
|
||||
var exitCode = await data.process.exitCode;
|
||||
print('======> Set Korean: ${exitCode == 0}');
|
||||
}
|
||||
return simpleFuture;
|
||||
}
|
||||
|
||||
Future<void> execute(Map<String, dynamic> buildMap) async {
|
||||
var c = Completer();
|
||||
DataBuild? build;
|
||||
|
|
|
|||
|
|
@ -34,9 +34,10 @@ class BuildDart implements Command {
|
|||
' && flutter pub run build_runner build --delete-conflicting-outputs');
|
||||
}
|
||||
|
||||
var process = await ProcessExecutor.run(await appendShell(shell, command),
|
||||
var process = await ProcessExecutor.start(await appendShell(shell, command),
|
||||
workspace: workspace);
|
||||
print('#### Exit Code: ${process.exitCode.toString()}');
|
||||
var exitCode = await process.process.exitCode;
|
||||
print('#### Exit Code: ${exitCode.toString()}');
|
||||
var passCode = [0, 64];
|
||||
//exitCode 65: package not defiend in pubspec.yaml
|
||||
var success = passCode.contains(process.exitCode);
|
||||
|
|
|
|||
|
|
@ -13,14 +13,12 @@ class BuildDotNet implements Command {
|
|||
var data = DataBuildDotNet.fromJson(command.param);
|
||||
var workspace = Application.instance.jenkinsData!.workspace;
|
||||
var shell = StringBuffer();
|
||||
// shell.writeln('C:\\Windows\\System32\\chcp.com 65001');
|
||||
shell.writeln('cd $workspace');
|
||||
shell.writeln(
|
||||
'MSBuild ${data.projectFile} /t:build /p:Configuration=Release;Platform=x86');
|
||||
var process = await ProcessExecutor.run(shell, workspace: workspace);
|
||||
// var exitCode = await process.process.exitCode;
|
||||
// c.complete(process.isSuccess);
|
||||
c.complete(process.exitCode == 0);
|
||||
var process = await ProcessExecutor.start(shell, workspace: workspace);
|
||||
var exitCode = await process.process.exitCode;
|
||||
c.complete(exitCode == 0);
|
||||
return c.future;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,14 +34,16 @@ class BuildiOS implements Command {
|
|||
shell.write(
|
||||
' && xcodebuild -workspace $workspacePath -scheme ${data.scheme} -destination $destination');
|
||||
|
||||
var process = await ProcessExecutor.run(shell, workspace: workspace);
|
||||
print('#### Exit Code: ${process.exitCode.toString()}');
|
||||
var success = process.exitCode == 0;
|
||||
// var process = await ProcessExecutor.run(shell, workspace: workspace);
|
||||
var processData = await ProcessExecutor.start(shell, workspace: workspace);
|
||||
var exitCode = await processData.process.exitCode;
|
||||
print('#### Exit Code: $exitCode');
|
||||
var success = exitCode == 0;
|
||||
if (success) {
|
||||
c.complete(success);
|
||||
return c.future;
|
||||
} else {
|
||||
if (process.exitCode == 31) {
|
||||
if (exitCode == 31) {
|
||||
data.cleanPod = true;
|
||||
command.param = data.toJson();
|
||||
return await execute(command);
|
||||
|
|
@ -68,10 +70,10 @@ class ArchiveiOS implements Command {
|
|||
shell.write(
|
||||
'xcodebuild -workspace $workspacePath -scheme ${data.scheme} -archivePath $archivePath archive');
|
||||
|
||||
var process = await ProcessExecutor.run(shell, workspace: workspace);
|
||||
print('#### Exit Code: ${process.exitCode.toString()}');
|
||||
var success = process.exitCode == 0;
|
||||
c.complete(success);
|
||||
var processData = await ProcessExecutor.start(shell, workspace: workspace);
|
||||
var exitCode = await processData.process.exitCode;
|
||||
print('#### Exit Code: $exitCode');
|
||||
c.complete(exitCode == 0);
|
||||
return c.future;
|
||||
}
|
||||
}
|
||||
|
|
@ -93,10 +95,10 @@ class ExportiOS implements Command {
|
|||
shell.write(
|
||||
'xcodebuild -exportArchive -archivePath $archivePath -exportPath $exportPath -exportOptionsPlist $exportOptionPlistPath');
|
||||
|
||||
var process = await ProcessExecutor.run(shell, workspace: workspace);
|
||||
print('#### Exit Code: ${process.exitCode.toString()}');
|
||||
var success = process.exitCode == 0;
|
||||
c.complete(success);
|
||||
var processData = await ProcessExecutor.start(shell, workspace: workspace);
|
||||
var exitCode = await processData.process.exitCode;
|
||||
print('#### Exit Code: $exitCode');
|
||||
c.complete(exitCode == 0);
|
||||
return c.future;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue