@@ -1363,36 +1363,29 @@ export class ProjectConfiguration<T extends BuilderConfigData>
13631363
13641364 const eidePrjObj = < ProjectConfigData < T > > utility . deepCloneObject ( this . config ) ;
13651365
1366- // handle data
1367- {
1368- //
1369- // store target
1370- //
1366+ //
1367+ // store target
1368+ //
13711369
1372- eidePrjObj . targets [ eidePrjObj . mode ] = this . cloneCurrentTarget ( ) ;
1370+ eidePrjObj . targets [ eidePrjObj . mode ] = this . cloneCurrentTarget ( ) ;
13731371
1374- const usrCtx = this . getProjectUsrCtx ( ) ;
1375- usrCtx . target = eidePrjObj . mode ;
1376- this . setProjectUsrCtx ( usrCtx ) ;
1377-
1378- //
1379- // convert abspath to relative path before save to file
1380- //
1372+ //
1373+ // convert abspath to relative path before save to file
1374+ //
13811375
1382- eidePrjObj . srcDirs = eidePrjObj . srcDirs . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
1376+ eidePrjObj . srcDirs = eidePrjObj . srcDirs . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
13831377
1384- // ignore some 'dynamic' dependence
1385- eidePrjObj . dependenceList = eidePrjObj . dependenceList . filter ( ( g ) => {
1386- return g . groupName !== ProjectConfiguration . BUILD_IN_GROUP_NAME
1387- && g . groupName !== ProjectConfiguration . CUSTOM_GROUP_NAME ;
1388- } ) ;
1378+ // ignore some 'dynamic' dependence
1379+ eidePrjObj . dependenceList = eidePrjObj . dependenceList . filter ( ( g ) => {
1380+ return g . groupName !== ProjectConfiguration . BUILD_IN_GROUP_NAME
1381+ && g . groupName !== ProjectConfiguration . CUSTOM_GROUP_NAME ;
1382+ } ) ;
13891383
1390- for ( const depGroup of eidePrjObj . dependenceList ) {
1391- for ( const dep of depGroup . depList ) {
1392- dep . incList = dep . incList . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
1393- dep . libList = dep . libList . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
1394- dep . sourceDirList = dep . sourceDirList . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
1395- }
1384+ for ( const depGroup of eidePrjObj . dependenceList ) {
1385+ for ( const dep of depGroup . depList ) {
1386+ dep . incList = dep . incList . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
1387+ dep . libList = dep . libList . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
1388+ dep . sourceDirList = dep . sourceDirList . map ( ( path ) => { return this . toRelativePath ( path ) ; } ) ;
13961389 }
13971390 }
13981391
@@ -1408,6 +1401,18 @@ export class ProjectConfiguration<T extends BuilderConfigData>
14081401
14091402 return utility . ToJsonStringExclude ( eidePrjObj , excKeys , 2 ) ;
14101403 }
1404+
1405+ Save ( force ?: boolean ) {
1406+
1407+ const usrCtx = this . getProjectUsrCtx ( ) ;
1408+
1409+ // save current target
1410+ usrCtx . target = this . config . mode ;
1411+
1412+ this . setProjectUsrCtx ( usrCtx ) ;
1413+
1414+ super . Save ( ) ;
1415+ }
14111416}
14121417
14131418// ======================== config base =============================
0 commit comments