@@ -6,7 +6,7 @@ import { warningOut } from '../../cli';
66import { name } from '../../../webpack.config' ;
77import { FolderOptions , getFolderOptions } from './folderSettings' ;
88import { readAllRules } from './customRules' ;
9- import { CompileData , CommandParameters } from '../environment' ;
9+ import { CompileData , CommandParameters , getTrueBasename } from '../environment' ;
1010import { iProject } from '../iProject' ;
1111import { ReadFileSystem } from '../../readFileSystem' ;
1212import { ProjectActions } from '../actions' ;
@@ -271,12 +271,30 @@ export class MakeProject {
271271 const parentName = ileObject . relativePath ? path . dirname ( ileObject . relativePath ) : undefined ;
272272 const qsysTempName : string | undefined = ( parentName && parentName . length > 10 ? parentName . substring ( 0 , 10 ) : parentName ) ;
273273
274+ const simpleReplace = ( str : string , search : string , replace : string ) => {
275+ return str . replace ( new RegExp ( search , `gi` ) , replace ) ;
276+ }
277+
274278 const resolve = ( command : string ) => {
275279 command = command . replace ( new RegExp ( `\\*CURLIB` , `g` ) , `$(BIN_LIB)` ) ;
276280 command = command . replace ( new RegExp ( `\\$\\*` , `g` ) , ileObject . systemName ) ;
277281 command = command . replace ( new RegExp ( `\\$<` , `g` ) , asPosix ( ileObject . relativePath ) ) ;
278282 command = command . replace ( new RegExp ( `\\$\\(SRCPF\\)` , `g` ) , qsysTempName ) ;
279283
284+ // Additionally, we have to support Actions variables
285+ command = simpleReplace ( command , `&BUILDLIB` , `$(BIN_LIB)` ) ;
286+ command = simpleReplace ( command , `&CURLIB` , `$(BIN_LIB)` ) ;
287+ command = simpleReplace ( command , `&LIBLS` , `` ) ;
288+ command = simpleReplace ( command , `&BRANCHLIB` , `$(BIN_LIB)` ) ;
289+
290+ const pathDetail = path . parse ( ileObject . relativePath || `` ) ;
291+
292+ command = simpleReplace ( command , `&RELATIVEPATH` , asPosix ( ileObject . relativePath ) ) ;
293+ command = simpleReplace ( command , `&BASENAME` , pathDetail . base ) ;
294+ command = simpleReplace ( command , `{filename}` , pathDetail . base ) ;
295+ command = simpleReplace ( command , `&NAME` , getTrueBasename ( pathDetail . name ) ) ;
296+ command = simpleReplace ( command , `&EXTENSION` , pathDetail . ext . startsWith ( `.` ) ? pathDetail . ext . substring ( 1 ) : pathDetail . ext ) ;
297+
280298 if ( ileObject . deps && ileObject . deps . length > 0 ) {
281299 // This piece of code adds special variables that can be used for building dependencies
282300 const uniqueObjectTypes = ileObject . deps . map ( d => d . type ) . filter ( ( value , index , array ) => array . indexOf ( value ) === index ) ;
0 commit comments