@@ -75,6 +75,20 @@ export class Console extends Runner {
7575 return result ;
7676 }
7777
78+ runBuildJava ( step : Step , command : Command ) : RunResult {
79+ let result = new RunResult ( ) ;
80+ result . returnCode = 0 ;
81+
82+ let projectDir = path . join ( this . getWorkingDirectory ( ) , "devonfw" , "workspaces" , "main" , command . parameters [ 0 ] )
83+ if ( this . platform == ConsolePlatform . WINDOWS ) {
84+ this . executeCommandSync ( "devon mvn clean install -Dmaven.test.skip=" + ! command . parameters [ 1 ] , projectDir , result ) ;
85+ } else {
86+ this . executeCommandSync ( "~/.devon/devon mvn clean install -Dmaven.test.skip=" + ! command . parameters [ 1 ] , projectDir , result ) ;
87+ }
88+
89+ return result ;
90+ }
91+
7892 runCobiGenJava ( step : Step , command : Command ) : RunResult {
7993 return null ;
8094 }
@@ -103,6 +117,17 @@ export class Console extends Runner {
103117 . fileExits ( path . join ( this . getWorkingDirectory ( ) , "devonfw" , "software" , "cobigen-cli" , "cobigen" ) ) ;
104118 }
105119
120+ async assertBuildJava ( step : Step , command : Command , result : RunResult ) {
121+ let workspaceDir = path . join ( this . getWorkingDirectory ( ) , "devonfw" , "workspaces" , "main" ) ;
122+
123+ new Assertions ( )
124+ . noErrorCode ( result )
125+ . noException ( result )
126+ . directoryExits ( path . join ( workspaceDir , command . parameters [ 0 ] , "api" , "target" ) )
127+ . directoryExits ( path . join ( workspaceDir , command . parameters [ 0 ] , "core" , "target" ) )
128+ . directoryExits ( path . join ( workspaceDir , command . parameters [ 0 ] , "server" , "target" ) ) ;
129+ }
130+
106131 async assertCobiGenJava ( step : Step , command : Command , result : RunResult ) {
107132 console . log ( "there is no assertion yet for the cobiGenJava command" ) ;
108133 }
@@ -123,7 +148,7 @@ export class Console extends Runner {
123148 private executeCommandSync ( command : string , directory : string , result : RunResult , input ?: string ) {
124149 if ( result . returnCode != 0 ) return ;
125150
126- let process = child_process . spawnSync ( command , { shell : true , cwd : directory , input : input } ) ;
151+ let process = child_process . spawnSync ( command , { shell : true , cwd : directory , input : input , maxBuffer : Infinity } ) ;
127152 if ( process . status != 0 ) {
128153 console . log ( "Error executing command: " + command + " (exit code: " + process . status + ")" ) ;
129154 console . log ( process . stderr . toString ( ) , process . stdout . toString ( ) ) ;
0 commit comments