Skip to content

Commit

Permalink
Merge pull request #1191 from flexn-io/feat/extend-platform
Browse files Browse the repository at this point in the history
[feat] extend platform
  • Loading branch information
pavjacko authored Oct 20, 2023
2 parents ce134e7 + ba6b7fc commit e18df59
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/jsonSchema/rnv.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3814,8 +3814,7 @@
"workspaceID",
"projectName",
"templates",
"currentTemplate",
"isNew"
"currentTemplate"
],
"additionalProperties": false
}
Expand Down
13 changes: 13 additions & 0 deletions packages/core/src/configs/buildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { getContext } from '../context/provider';
import type { RnvContext } from '../context/types';
import { ConfigFileBuildConfig } from '../schema/configFiles/buildConfig';
import { FileUtilsPropConfig } from '../system/types';
import { PlatformKey } from '../schema/types';

const _arrayMergeOverride = (_destinationArray: Array<string>, sourceArray: Array<string>) => sourceArray;

Expand Down Expand Up @@ -150,6 +151,18 @@ export const generateBuildConfig = (_c?: RnvContext) => {
};
c.buildConfig = sanitizeDynamicProps(c.buildConfig, propConfig);

//Merge extendPlatform
const platforms = c.buildConfig.platforms || {};
(Object.keys(platforms) as PlatformKey[]).forEach((k) => {
const plat = platforms[k];
if (plat?.extendPlatform) {
const extPlat = platforms[plat?.extendPlatform];
if (extPlat) {
platforms[k] = merge(plat, extPlat);
}
}
});

logDebug('BUILD_CONFIG', Object.keys(c.buildConfig));

if (c.runtime.appId) {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/schema/configFiles/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const RootProjectBaseFragment = {
),
isNew: z
.string()
.optional()
.describe('Marker indicating that this project has just been bootstrapped. this prop is managed by rnv'),
};

Expand Down
1 change: 1 addition & 0 deletions packages/template-starter/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"version": "^1.0.0-canary.7"
}
},
"currentTemplate": "@rnv/template-starter",
"platforms": {
"android": {
"minSdkVersion": 26,
Expand Down

0 comments on commit e18df59

Please sign in to comment.