Skip to content

Commit 87f8e85

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Move generated code to ReactCodegen and ReactappDependencyProvider folder (facebook#53618)
Summary: Pull Request resolved: facebook#53618 This change makes sure that we generate the codegen files in the ReactCodegen and ReactAppDependencyProvider folder. This is necessary as Swift PM needs the source code of packages to be grouped in folders that are children of where the Package.swift is located. This is not a breaking change, because Cocoapods has been updated accordingly, import/include paths are not changed and the folder layout should not be accessed by anybody directly ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81769522 fbshipit-source-id: 7c70f96a9aa503c4faaf173b94c8ee0e326094a1
1 parent f6f5ea0 commit 87f8e85

File tree

5 files changed

+144
-119
lines changed

5 files changed

+144
-119
lines changed

packages/react-native/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`execute test-app "RCTAppDependencyProvider.h" should match snapshot 1`] = `
3+
exports[`execute test-app "ReactAppDependencyProvider/RCTAppDependencyProvider.h" should match snapshot 1`] = `
44
"/*
55
* Copyright (c) Meta Platforms, Inc. and affiliates.
66
*
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_END
2929
"
3030
`;
3131
32-
exports[`execute test-app "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
32+
exports[`execute test-app "ReactAppDependencyProvider/RCTAppDependencyProvider.mm" should match snapshot 1`] = `
3333
"/*
3434
* Copyright (c) Meta Platforms, Inc. and affiliates.
3535
*
@@ -73,7 +73,45 @@ exports[`execute test-app "RCTAppDependencyProvider.mm" should match snapshot 1`
7373
"
7474
`;
7575
76-
exports[`execute test-app "RCTModuleProviders.h" should match snapshot 1`] = `
76+
exports[`execute test-app "ReactAppDependencyProvider/ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
77+
"# Copyright (c) Meta Platforms, Inc. and affiliates.
78+
#
79+
# This source code is licensed under the MIT license found in the
80+
# LICENSE file in the root directory of this source tree.
81+
82+
version = \\"1000.0.0\\"
83+
source = { :git => 'https://github.com/facebook/react-native.git' }
84+
if version == '1000.0.0'
85+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
86+
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
87+
else
88+
source[:tag] = \\"v#{version}\\"
89+
end
90+
91+
Pod::Spec.new do |s|
92+
s.name = \\"ReactAppDependencyProvider\\"
93+
s.version = version
94+
s.summary = \\"The third party dependency provider for the app\\"
95+
s.homepage = \\"https://reactnative.dev/\\"
96+
s.documentation_url = \\"https://reactnative.dev/\\"
97+
s.license = \\"MIT\\"
98+
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
99+
s.platforms = min_supported_versions
100+
s.source = source
101+
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
102+
103+
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
104+
s.pod_target_xcconfig = {
105+
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
106+
\\"DEFINES_MODULE\\" => \\"YES\\"
107+
}
108+
109+
s.dependency \\"ReactCodegen\\"
110+
end
111+
"
112+
`;
113+
114+
exports[`execute test-app "ReactCodegen/RCTModuleProviders.h" should match snapshot 1`] = `
77115
"/*
78116
* Copyright (c) Meta Platforms, Inc. and affiliates.
79117
*
@@ -93,7 +131,7 @@ exports[`execute test-app "RCTModuleProviders.h" should match snapshot 1`] = `
93131
"
94132
`;
95133
96-
exports[`execute test-app "RCTModuleProviders.mm" should match snapshot 1`] = `
134+
exports[`execute test-app "ReactCodegen/RCTModuleProviders.mm" should match snapshot 1`] = `
97135
"/*
98136
* Copyright (c) Meta Platforms, Inc. and affiliates.
99137
*
@@ -159,7 +197,7 @@ exports[`execute test-app "RCTModuleProviders.mm" should match snapshot 1`] = `
159197
"
160198
`;
161199
162-
exports[`execute test-app "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
200+
exports[`execute test-app "ReactCodegen/RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
163201
"/*
164202
* Copyright (c) Meta Platforms, Inc. and affiliates.
165203
*
@@ -181,7 +219,7 @@ exports[`execute test-app "RCTModulesConformingToProtocolsProvider.h" should mat
181219
"
182220
`;
183221
184-
exports[`execute test-app "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
222+
exports[`execute test-app "ReactCodegen/RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
185223
"/*
186224
* Copyright (c) Meta Platforms, Inc. and affiliates.
187225
*
@@ -248,7 +286,7 @@ exports[`execute test-app "RCTModulesConformingToProtocolsProvider.mm" should ma
248286
"
249287
`;
250288
251-
exports[`execute test-app "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
289+
exports[`execute test-app "ReactCodegen/RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
252290
"/*
253291
* Copyright (c) Meta Platforms, Inc. and affiliates.
254292
*
@@ -268,7 +306,7 @@ exports[`execute test-app "RCTThirdPartyComponentsProvider.h" should match snaps
268306
"
269307
`;
270308
271-
exports[`execute test-app "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
309+
exports[`execute test-app "ReactCodegen/RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
272310
"/*
273311
* Copyright (c) Meta Platforms, Inc. and affiliates.
274312
*
@@ -303,7 +341,7 @@ exports[`execute test-app "RCTThirdPartyComponentsProvider.mm" should match snap
303341
"
304342
`;
305343
306-
exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
344+
exports[`execute test-app "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
307345
"/*
308346
* Copyright (c) Meta Platforms, Inc. and affiliates.
309347
*
@@ -321,7 +359,7 @@ exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.h"
321359
"
322360
`;
323361
324-
exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
362+
exports[`execute test-app "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
325363
"/*
326364
* Copyright (c) Meta Platforms, Inc. and affiliates.
327365
*
@@ -355,45 +393,7 @@ exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.mm"
355393
"
356394
`;
357395
358-
exports[`execute test-app "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
359-
"# Copyright (c) Meta Platforms, Inc. and affiliates.
360-
#
361-
# This source code is licensed under the MIT license found in the
362-
# LICENSE file in the root directory of this source tree.
363-
364-
version = \\"1000.0.0\\"
365-
source = { :git => 'https://github.com/facebook/react-native.git' }
366-
if version == '1000.0.0'
367-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
368-
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
369-
else
370-
source[:tag] = \\"v#{version}\\"
371-
end
372-
373-
Pod::Spec.new do |s|
374-
s.name = \\"ReactAppDependencyProvider\\"
375-
s.version = version
376-
s.summary = \\"The third party dependency provider for the app\\"
377-
s.homepage = \\"https://reactnative.dev/\\"
378-
s.documentation_url = \\"https://reactnative.dev/\\"
379-
s.license = \\"MIT\\"
380-
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
381-
s.platforms = min_supported_versions
382-
s.source = source
383-
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
384-
385-
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
386-
s.pod_target_xcconfig = {
387-
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
388-
\\"DEFINES_MODULE\\" => \\"YES\\"
389-
}
390-
391-
s.dependency \\"ReactCodegen\\"
392-
end
393-
"
394-
`;
395-
396-
exports[`execute test-app "ReactCodegen.podspec" should match snapshot 1`] = `
396+
exports[`execute test-app "ReactCodegen/ReactCodegen.podspec" should match snapshot 1`] = `
397397
"# Copyright (c) Meta Platforms, Inc. and affiliates.
398398
#
399399
# This source code is licensed under the MIT license found in the
@@ -507,7 +507,7 @@ end
507507
"
508508
`;
509509
510-
exports[`execute test-app-legacy "RCTAppDependencyProvider.h" should match snapshot 1`] = `
510+
exports[`execute test-app-legacy "ReactAppDependencyProvider/RCTAppDependencyProvider.h" should match snapshot 1`] = `
511511
"/*
512512
* Copyright (c) Meta Platforms, Inc. and affiliates.
513513
*
@@ -536,7 +536,7 @@ NS_ASSUME_NONNULL_END
536536
"
537537
`;
538538
539-
exports[`execute test-app-legacy "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
539+
exports[`execute test-app-legacy "ReactAppDependencyProvider/RCTAppDependencyProvider.mm" should match snapshot 1`] = `
540540
"/*
541541
* Copyright (c) Meta Platforms, Inc. and affiliates.
542542
*
@@ -580,7 +580,45 @@ exports[`execute test-app-legacy "RCTAppDependencyProvider.mm" should match snap
580580
"
581581
`;
582582
583-
exports[`execute test-app-legacy "RCTModuleProviders.h" should match snapshot 1`] = `
583+
exports[`execute test-app-legacy "ReactAppDependencyProvider/ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
584+
"# Copyright (c) Meta Platforms, Inc. and affiliates.
585+
#
586+
# This source code is licensed under the MIT license found in the
587+
# LICENSE file in the root directory of this source tree.
588+
589+
version = \\"1000.0.0\\"
590+
source = { :git => 'https://github.com/facebook/react-native.git' }
591+
if version == '1000.0.0'
592+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
593+
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
594+
else
595+
source[:tag] = \\"v#{version}\\"
596+
end
597+
598+
Pod::Spec.new do |s|
599+
s.name = \\"ReactAppDependencyProvider\\"
600+
s.version = version
601+
s.summary = \\"The third party dependency provider for the app\\"
602+
s.homepage = \\"https://reactnative.dev/\\"
603+
s.documentation_url = \\"https://reactnative.dev/\\"
604+
s.license = \\"MIT\\"
605+
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
606+
s.platforms = min_supported_versions
607+
s.source = source
608+
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
609+
610+
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
611+
s.pod_target_xcconfig = {
612+
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
613+
\\"DEFINES_MODULE\\" => \\"YES\\"
614+
}
615+
616+
s.dependency \\"ReactCodegen\\"
617+
end
618+
"
619+
`;
620+
621+
exports[`execute test-app-legacy "ReactCodegen/RCTModuleProviders.h" should match snapshot 1`] = `
584622
"/*
585623
* Copyright (c) Meta Platforms, Inc. and affiliates.
586624
*
@@ -600,7 +638,7 @@ exports[`execute test-app-legacy "RCTModuleProviders.h" should match snapshot 1`
600638
"
601639
`;
602640
603-
exports[`execute test-app-legacy "RCTModuleProviders.mm" should match snapshot 1`] = `
641+
exports[`execute test-app-legacy "ReactCodegen/RCTModuleProviders.mm" should match snapshot 1`] = `
604642
"/*
605643
* Copyright (c) Meta Platforms, Inc. and affiliates.
606644
*
@@ -657,7 +695,7 @@ exports[`execute test-app-legacy "RCTModuleProviders.mm" should match snapshot 1
657695
"
658696
`;
659697
660-
exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
698+
exports[`execute test-app-legacy "ReactCodegen/RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
661699
"/*
662700
* Copyright (c) Meta Platforms, Inc. and affiliates.
663701
*
@@ -679,7 +717,7 @@ exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.h" sho
679717
"
680718
`;
681719
682-
exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
720+
exports[`execute test-app-legacy "ReactCodegen/RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
683721
"/*
684722
* Copyright (c) Meta Platforms, Inc. and affiliates.
685723
*
@@ -737,7 +775,7 @@ exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.mm" sh
737775
"
738776
`;
739777
740-
exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
778+
exports[`execute test-app-legacy "ReactCodegen/RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
741779
"/*
742780
* Copyright (c) Meta Platforms, Inc. and affiliates.
743781
*
@@ -757,7 +795,7 @@ exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.h" should matc
757795
"
758796
`;
759797
760-
exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
798+
exports[`execute test-app-legacy "ReactCodegen/RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
761799
"/*
762800
* Copyright (c) Meta Platforms, Inc. and affiliates.
763801
*
@@ -791,7 +829,7 @@ exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.mm" should mat
791829
"
792830
`;
793831
794-
exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
832+
exports[`execute test-app-legacy "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
795833
"/*
796834
* Copyright (c) Meta Platforms, Inc. and affiliates.
797835
*
@@ -809,7 +847,7 @@ exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvi
809847
"
810848
`;
811849
812-
exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
850+
exports[`execute test-app-legacy "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
813851
"/*
814852
* Copyright (c) Meta Platforms, Inc. and affiliates.
815853
*
@@ -834,45 +872,7 @@ exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvi
834872
"
835873
`;
836874
837-
exports[`execute test-app-legacy "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
838-
"# Copyright (c) Meta Platforms, Inc. and affiliates.
839-
#
840-
# This source code is licensed under the MIT license found in the
841-
# LICENSE file in the root directory of this source tree.
842-
843-
version = \\"1000.0.0\\"
844-
source = { :git => 'https://github.com/facebook/react-native.git' }
845-
if version == '1000.0.0'
846-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
847-
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
848-
else
849-
source[:tag] = \\"v#{version}\\"
850-
end
851-
852-
Pod::Spec.new do |s|
853-
s.name = \\"ReactAppDependencyProvider\\"
854-
s.version = version
855-
s.summary = \\"The third party dependency provider for the app\\"
856-
s.homepage = \\"https://reactnative.dev/\\"
857-
s.documentation_url = \\"https://reactnative.dev/\\"
858-
s.license = \\"MIT\\"
859-
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
860-
s.platforms = min_supported_versions
861-
s.source = source
862-
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
863-
864-
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
865-
s.pod_target_xcconfig = {
866-
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
867-
\\"DEFINES_MODULE\\" => \\"YES\\"
868-
}
869-
870-
s.dependency \\"ReactCodegen\\"
871-
end
872-
"
873-
`;
874-
875-
exports[`execute test-app-legacy "ReactCodegen.podspec" should match snapshot 1`] = `
875+
exports[`execute test-app-legacy "ReactCodegen/ReactCodegen.podspec" should match snapshot 1`] = `
876876
"# Copyright (c) Meta Platforms, Inc. and affiliates.
877877
#
878878
# This source code is licensed under the MIT license found in the

packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ const packageJson = JSON.stringify({
4242
});
4343

4444
[
45-
'RCTAppDependencyProvider.h',
46-
'RCTAppDependencyProvider.mm',
47-
'RCTModuleProviders.h',
48-
'RCTModuleProviders.mm',
49-
'RCTModulesConformingToProtocolsProvider.h',
50-
'RCTModulesConformingToProtocolsProvider.mm',
51-
'RCTThirdPartyComponentsProvider.h',
52-
'RCTThirdPartyComponentsProvider.mm',
53-
'ReactAppDependencyProvider.podspec',
54-
'ReactCodegen.podspec',
55-
'RCTUnstableModulesRequiringMainQueueSetupProvider.h',
56-
'RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
45+
'ReactAppDependencyProvider/RCTAppDependencyProvider.h',
46+
'ReactAppDependencyProvider/RCTAppDependencyProvider.mm',
47+
'ReactCodegen/RCTModuleProviders.h',
48+
'ReactCodegen/RCTModuleProviders.mm',
49+
'ReactCodegen/RCTModulesConformingToProtocolsProvider.h',
50+
'ReactCodegen/RCTModulesConformingToProtocolsProvider.mm',
51+
'ReactCodegen/RCTThirdPartyComponentsProvider.h',
52+
'ReactCodegen/RCTThirdPartyComponentsProvider.mm',
53+
'ReactAppDependencyProvider/ReactAppDependencyProvider.podspec',
54+
'ReactCodegen/ReactCodegen.podspec',
55+
'ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h',
56+
'ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
5757
].forEach(file => {
5858
it(`"${file}" should match snapshot`, () => {
5959
const generatedFileDir = path.join(outputDir, 'build/generated/ios');

0 commit comments

Comments
 (0)