@@ -1421,8 +1421,9 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
14211421 targets [ targetName ] = prjConfig . cloneCurrentTarget ( ) ;
14221422 }
14231423
1424- const oldBuilderOptsFile = prjConfig . compileConfigModel
1424+ const prevBuilderOptsFile = prjConfig . compileConfigModel
14251425 . getOptionsFile ( this . getEideDir ( ) . path , prjConfig . config ) ;
1426+ const prevSourcesOptsFile = this . getSourceExtraArgsCfgFile ( true ) ;
14261427
14271428 // update current target name
14281429 prjConfigData . mode = targetName ;
@@ -1485,12 +1486,24 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
14851486 . getOptionsFile ( this . getEideDir ( ) . path , prjConfig . config , true ) ;
14861487 if ( ! optsFile . IsFile ( ) ) {
14871488 try {
1488- fs . copyFileSync ( oldBuilderOptsFile . path , optsFile . path ) ;
1489+ fs . copyFileSync ( prevBuilderOptsFile . path , optsFile . path ) ;
14891490 } catch ( error ) {
14901491 // nothing todo
14911492 }
14921493 }
14931494
1495+ // if source options file is not existed, copy it.
1496+ if ( prevSourcesOptsFile . IsFile ( ) ) {
1497+ const srcOptsFile = File . fromArray ( [ this . getEideDir ( ) . path , `${ targetName . toLowerCase ( ) } .files.options.yml` ] ) ;
1498+ if ( ! srcOptsFile . IsFile ( ) ) {
1499+ try {
1500+ fs . copyFileSync ( prevSourcesOptsFile . path , srcOptsFile . path ) ;
1501+ } catch ( error ) {
1502+ // nothing todo
1503+ }
1504+ }
1505+ }
1506+
14941507 this . sourceRoots . forceUpdateAllFolders ( ) ;
14951508 this . virtualSource . forceUpdateAllFolders ( ) ;
14961509
0 commit comments