Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions packages/cli-config/src/__tests__/__snapshots__/index-test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ Object {
"configurations": Array [],
"podspecPath": "<<REPLACED>>/node_modules/react-native-test/ReactNativeTest.podspec",
"scriptPhases": Array [
"./abc",
Object {
"name": "abc",
"path": "./phase.sh",
},
],
},
},
Expand All @@ -68,7 +71,28 @@ Object {
"configurations": Array [],
"podspecPath": "<<REPLACED>>/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,
},
],
},
},
Expand Down
17 changes: 15 additions & 2 deletions packages/cli-config/src/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
}
Expand Down Expand Up @@ -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"}]
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-config/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({}),
Expand Down Expand Up @@ -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
Expand Down