diff --git a/packages/cli-config/src/__tests__/__snapshots__/index-test.ts.snap b/packages/cli-config/src/__tests__/__snapshots__/index-test.ts.snap index d70378976..c229660cd 100644 --- a/packages/cli-config/src/__tests__/__snapshots__/index-test.ts.snap +++ b/packages/cli-config/src/__tests__/__snapshots__/index-test.ts.snap @@ -51,7 +51,10 @@ Object { "configurations": Array [], "podspecPath": "<>/node_modules/react-native-test/ReactNativeTest.podspec", "scriptPhases": Array [ - "./abc", + Object { + "name": "abc", + "path": "./phase.sh", + }, ], }, }, @@ -68,7 +71,28 @@ Object { "configurations": Array [], "podspecPath": "<>/node_modules/react-native-test/ReactNativeTest.podspec", "scriptPhases": Array [ - "./customLocation/custom.sh", + Object { + "dependency_file": "/path/to/dependency/file", + "execution_position": "after_compile", + "input_file_lists": Array [ + "input_file_1", + "input_file_2", + ], + "input_files": Array [ + "input_file", + ], + "name": "[TEST] Some Configuration", + "output_file_lists": Array [ + "output_file_1", + "output_file_2", + ], + "output_files": Array [ + "output_file", + ], + "path": "./customLocation/custom.sh", + "shell_path": "some/shell/path/bash", + "show_env_vars_in_log": false, + }, ], }, }, diff --git a/packages/cli-config/src/__tests__/index-test.ts b/packages/cli-config/src/__tests__/index-test.ts index 91458dfd1..4b2096b77 100644 --- a/packages/cli-config/src/__tests__/index-test.ts +++ b/packages/cli-config/src/__tests__/index-test.ts @@ -97,7 +97,20 @@ test('should read a config of a dependency and use it to load other settings', ( dependency: { platforms: { ios: { - scriptPhases: ["./customLocation/custom.sh"] + scriptPhases: [ + { + name: "[TEST] Some Configuration", + path: "./customLocation/custom.sh", + execution_position: "after_compile", + input_files: ["input_file"], + shell_path: "some/shell/path/bash", + output_files: ["output_file"], + input_file_lists: ["input_file_1", "input_file_2"], + output_file_lists: ["output_file_1", "output_file_2"], + show_env_vars_in_log: false, + dependency_file: "/path/to/dependency/file" + } + ] } } } @@ -133,7 +146,7 @@ test('should merge project configuration with default values', () => { "react-native-test": { platforms: { ios: { - scriptPhases: ["./abc"] + scriptPhases: [{name: "abc", path: "./phase.sh"}] } }, } diff --git a/packages/cli-config/src/schema.ts b/packages/cli-config/src/schema.ts index c777f273d..6871329ae 100644 --- a/packages/cli-config/src/schema.ts +++ b/packages/cli-config/src/schema.ts @@ -69,7 +69,7 @@ export const dependencyConfig = t ios: t // IOSDependencyParams .object({ - scriptPhases: t.array().items(t.string()), + scriptPhases: t.array().items(t.object()), configurations: t.array().items(t.string()).default([]), }) .default({}), @@ -123,7 +123,7 @@ export const projectConfig = t .object({ podspecPath: t.string(), configurations: t.array().items(t.string()).default([]), - scriptPhases: t.array().items(t.string()).default([]), + scriptPhases: t.array().items(t.object()).default([]), }) .allow(null), android: t