@trainstar/synchro-react-native 0.4.0-rc.3 → 0.4.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,6 +58,69 @@ const repairs = {
58
58
  preimage: '451fe8050e20bc1c4724564b2c33fb819f815848f5ad2eb529be5915bf62f2bb',
59
59
  postimage: 'd22c16e9d4ebe97b15a3b734b70e1060a5526b907cad2b1ec3bb1004d4ed0675'
60
60
  }]
61
+ }],
62
+ rngp: [{
63
+ caller: 'react-native',
64
+ callerVersion: '0.88.0',
65
+ packageName: '@react-native/gradle-plugin',
66
+ version: '0.88.0',
67
+ patch: 'react-native-gradle-plugin-0.88.0-kotlin-2.4.21.patch',
68
+ sources: [{
69
+ path: 'gradle/libs.versions.toml',
70
+ preimage: 'c7a028cdee90f490de9493ca9de92b61b994844836161871091c340c568f109e',
71
+ postimage: '44a27d41062a7c01889fac1bc7666f8235ee14060de8588d66660830f8484c7d'
72
+ }, {
73
+ path: 'react-native-gradle-plugin/build.gradle.kts',
74
+ preimage: '44bcf53d885c52ef9988b7147e8e522563eaf519144109f40390fc7601a6469e',
75
+ postimage: 'cced8bd5897896d6f00149e4704b51130e8b9468f39ab4247f9aca0f2ddcc864'
76
+ }, {
77
+ path: 'settings-plugin/build.gradle.kts',
78
+ preimage: '326cc1d071e500711a12134d0577059929ae3e6960e2d1bfb10e0cffea8832f2',
79
+ postimage: '3af9b7ea340523e24e3492db32da30943dd840c3f2e656ffdc72b7a37129a3d5'
80
+ }, {
81
+ path: 'shared-testutil/build.gradle.kts',
82
+ preimage: '40950ae3b3bf68b35515f022f2819c98def11f0aee67ade7ed64f04c6f033cca',
83
+ postimage: '2db5af783296917c76c1f410ead33ed555310917a79b3b005ee996f1ac23a6d6'
84
+ }, {
85
+ path: 'shared/build.gradle.kts',
86
+ preimage: '7069a997b96e4c8a733a62e00d557730ab32bde6a5dc54dbd18d86d2bc302d09',
87
+ postimage: '5d8d113c7849a448d1abafb8fcdb545f389133fcd3fb6c68c12089de53e24c6c'
88
+ }]
89
+ }, {
90
+ caller: 'react-native',
91
+ callerVersion: '0.82.1',
92
+ packageName: '@react-native/gradle-plugin',
93
+ version: '0.82.1',
94
+ patch: 'react-native-gradle-plugin-0.82.1-kotlin-2.4.21.patch',
95
+ sources: [{
96
+ path: 'gradle/libs.versions.toml',
97
+ preimage: 'eea932505dd9efd2d660d8d10efddbe84b74ed47456d995099af7ab5d97d6802',
98
+ postimage: '8a30e112ad18be9bc95f509d1cc42affd09e23dd2cfe22677cd7c7703628247f'
99
+ }, {
100
+ path: 'react-native-gradle-plugin/build.gradle.kts',
101
+ preimage: 'b45b3f39996d9db2b54c68cca073063c605d313aae548f633b6a00fc6df556b0',
102
+ postimage: 'f0b609f0c29dbd6e90de935d3d6690b5cc6dd61f314345ccb662a0baf11a5fcc'
103
+ }, {
104
+ path: 'settings-plugin/build.gradle.kts',
105
+ preimage: '18d28065072ad8c93656deadfbcff095a05fd6a58e25d047eb69d839e347aa97',
106
+ postimage: '95b2086c29bd771fd9e52d23c931897852d6669138f0939a1b26a14f67c9a41e'
107
+ }, {
108
+ path: 'shared-testutil/build.gradle.kts',
109
+ preimage: '8cb397c7d640a836c2edce904cf2fbf90c069a2b228b539c0243e3d7997854bf',
110
+ postimage: '9af52f0cdf6f76a713598db2da6c7679390625028a23a0946c27d9df580d4bdc'
111
+ }, {
112
+ path: 'shared/build.gradle.kts',
113
+ preimage: 'fd66179022462615f054ccf03af25bc8b9399dc6b492d75b022bf2961f0f034e',
114
+ postimage: '00a4789ebba1fea4cfd6e0d3ef298fda7af7a462306ede91081d01c94cd74a92'
115
+ }, {
116
+ path: 'react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt',
117
+ preimage: '0d8511fc8c814b40a910b894986665784ef36a977c139923e92bfc62ef4cb845',
118
+ postimage: '8d47cc51b9759d19a400fc015a455cd137b867c8db69b06f19e7ed4e50d30151'
119
+ }, {
120
+ path: 'react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt',
121
+ preimage: 'd25dbfc8d9ee685269e22cddff9f4e86691fe922074dde32e1c5662d9a406309',
122
+ postimage: 'd1e7e31b236484cf06521e64eadff3c85502e822c08351de7caf7a78ed51bea0'
123
+ }]
61
124
  }]
62
125
  };
63
126
 
@@ -154,10 +217,28 @@ function applyRepair(repair) {
154
217
  process.stdout.write(`applied verified ${repair.packageName} ${repair.version} patch\n`);
155
218
  }
156
219
 
220
+ function hasCallerIdentity(repair) {
221
+ try {
222
+ const caller = callerRoot(repair);
223
+ const manifest = JSON.parse(fs.readFileSync(path.join(caller, 'package.json'), 'utf8'));
224
+ return manifest.name === repair.caller && manifest.version === repair.callerVersion;
225
+ } catch {
226
+ return false;
227
+ }
228
+ }
229
+
230
+ function selectedRepairs(name) {
231
+ const candidates = repairs[name];
232
+ if (name !== 'rngp') return candidates;
233
+ const selected = candidates.filter(hasCallerIdentity);
234
+ if (selected.length !== 1) fail('unsupported React Native Gradle Plugin version');
235
+ return selected;
236
+ }
237
+
157
238
  const name = process.argv[2] || 'cli';
158
239
  if (!Object.prototype.hasOwnProperty.call(repairs, name)) {
159
240
  fail('unsupported repair');
160
241
  }
161
- for (const repair of repairs[name]) {
242
+ for (const repair of selectedRepairs(name)) {
162
243
  applyRepair(repair);
163
244
  }
@@ -0,0 +1,131 @@
1
+ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
2
+ --- a/gradle/libs.versions.toml
3
+ +++ b/gradle/libs.versions.toml
4
+ @@ -7 +7 @@
5
+ -kotlin = "2.1.20"
6
+ +kotlin = "2.4.21"
7
+ diff --git a/react-native-gradle-plugin/build.gradle.kts b/react-native-gradle-plugin/build.gradle.kts
8
+ --- a/react-native-gradle-plugin/build.gradle.kts
9
+ +++ b/react-native-gradle-plugin/build.gradle.kts
10
+ @@ -67 +67 @@
11
+ - apiVersion.set(KotlinVersion.KOTLIN_1_8)
12
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
13
+ diff --git a/settings-plugin/build.gradle.kts b/settings-plugin/build.gradle.kts
14
+ --- a/settings-plugin/build.gradle.kts
15
+ +++ b/settings-plugin/build.gradle.kts
16
+ @@ -57 +57 @@
17
+ - apiVersion.set(KotlinVersion.KOTLIN_1_8)
18
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
19
+ diff --git a/shared-testutil/build.gradle.kts b/shared-testutil/build.gradle.kts
20
+ --- a/shared-testutil/build.gradle.kts
21
+ +++ b/shared-testutil/build.gradle.kts
22
+ @@ -30 +30 @@
23
+ - apiVersion.set(KotlinVersion.KOTLIN_1_8)
24
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
25
+ diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts
26
+ --- a/shared/build.gradle.kts
27
+ +++ b/shared/build.gradle.kts
28
+ @@ -36 +36 @@
29
+ - apiVersion.set(KotlinVersion.KOTLIN_1_8)
30
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
31
+ diff --git a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt
32
+ --- a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt
33
+ +++ b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt
34
+ @@ -100,6 +100,17 @@
35
+ - // Library Only Configuration
36
+ - configureBuildConfigFieldsForLibraries(project)
37
+ - configureNamespaceForLibraries(project)
38
+ - project.pluginManager.withPlugin("com.android.library") {
39
+ - configureCodegen(project, extension, rootExtension, isLibrary = true)
40
+ - }
41
+ + project.pluginManager.withPlugin("com.android.application") {
42
+ + project.rootProject.allprojects { subproject ->
43
+ + subproject.pluginManager.withPlugin("com.android.library") {
44
+ + if (!subproject.state.executed) {
45
+ + configureBuildConfigFieldsForLibraries(subproject)
46
+ + configureNamespaceForLibraries(subproject)
47
+ + }
48
+ + }
49
+ + }
50
+ + }
51
+ +
52
+ + // Library Only Configuration
53
+ + project.pluginManager.withPlugin("com.android.library") {
54
+ + configureBuildConfigFieldsForLibraries(project)
55
+ + configureNamespaceForLibraries(project)
56
+ + configureCodegen(project, extension, rootExtension, isLibrary = true)
57
+ + }
58
+ diff --git a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt
59
+ --- a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt
60
+ +++ b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt
61
+ @@ -84,9 +83,9 @@
62
+ - fun configureBuildConfigFieldsForLibraries(appProject: Project) {
63
+ - appProject.rootProject.allprojects { subproject ->
64
+ - subproject.pluginManager.withPlugin("com.android.library") {
65
+ - subproject.extensions
66
+ - .getByType(LibraryAndroidComponentsExtension::class.java)
67
+ - .finalizeDsl { ext -> ext.buildFeatures.buildConfig = true }
68
+ - }
69
+ - }
70
+ - }
71
+ + fun configureBuildConfigFieldsForLibraries(project: Project) {
72
+ + if (project.extensions.extraProperties.has(BUILD_CONFIG_FIELDS_CONFIGURED_PROPERTY)) {
73
+ + return
74
+ + }
75
+ + project.extensions.extraProperties.set(BUILD_CONFIG_FIELDS_CONFIGURED_PROPERTY, true)
76
+ + project.extensions
77
+ + .getByType(LibraryAndroidComponentsExtension::class.java)
78
+ + .finalizeDsl { ext -> ext.buildFeatures.buildConfig = true }
79
+ + }
80
+ @@ -116,22 +116,22 @@
81
+ - fun configureNamespaceForLibraries(appProject: Project) {
82
+ - appProject.rootProject.allprojects { subproject ->
83
+ - subproject.pluginManager.withPlugin("com.android.library") {
84
+ - subproject.extensions
85
+ - .getByType(LibraryAndroidComponentsExtension::class.java)
86
+ - .finalizeDsl { ext ->
87
+ - if (ext.namespace == null) {
88
+ - val android = subproject.extensions.getByType(LibraryExtension::class.java)
89
+ - val manifestFile = android.sourceSets.getByName("main").manifest.srcFile
90
+ -
91
+ - manifestFile
92
+ - .takeIf { it.exists() }
93
+ - ?.let { file ->
94
+ - getPackageNameFromManifest(file)?.let { packageName ->
95
+ - ext.namespace = packageName
96
+ - }
97
+ - }
98
+ - }
99
+ - }
100
+ - }
101
+ - }
102
+ - }
103
+ + fun configureNamespaceForLibraries(project: Project) {
104
+ + if (project.extensions.extraProperties.has(NAMESPACE_CONFIGURED_PROPERTY)) {
105
+ + return
106
+ + }
107
+ + project.extensions.extraProperties.set(NAMESPACE_CONFIGURED_PROPERTY, true)
108
+ + project.extensions
109
+ + .getByType(LibraryAndroidComponentsExtension::class.java)
110
+ + .finalizeDsl { ext ->
111
+ + if (ext.namespace == null) {
112
+ + val android = project.extensions.getByType(LibraryExtension::class.java)
113
+ + val manifestFile = android.sourceSets.getByName("main").manifest.srcFile
114
+ +
115
+ + manifestFile
116
+ + .takeIf { it.exists() }
117
+ + ?.let { file ->
118
+ + getPackageNameFromManifest(file)?.let { packageName ->
119
+ + ext.namespace = packageName
120
+ + }
121
+ + }
122
+ + }
123
+ + }
124
+ + }
125
+ @@ -139 +139,5 @@
126
+ -
127
+ +
128
+ +private const val BUILD_CONFIG_FIELDS_CONFIGURED_PROPERTY =
129
+ + "com.facebook.react.internal.buildConfigFieldsConfigured"
130
+ +private const val NAMESPACE_CONFIGURED_PROPERTY = "com.facebook.react.internal.namespaceConfigured"
131
+ +
@@ -0,0 +1,30 @@
1
+ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
2
+ --- a/gradle/libs.versions.toml
3
+ +++ b/gradle/libs.versions.toml
4
+ @@ -7 +7 @@
5
+ -kotlin = "2.2.0"
6
+ +kotlin = "2.4.21"
7
+ diff --git a/react-native-gradle-plugin/build.gradle.kts b/react-native-gradle-plugin/build.gradle.kts
8
+ --- a/react-native-gradle-plugin/build.gradle.kts
9
+ +++ b/react-native-gradle-plugin/build.gradle.kts
10
+ @@ -67 +67 @@
11
+ - apiVersion.set(KotlinVersion.KOTLIN_2_0)
12
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
13
+ diff --git a/settings-plugin/build.gradle.kts b/settings-plugin/build.gradle.kts
14
+ --- a/settings-plugin/build.gradle.kts
15
+ +++ b/settings-plugin/build.gradle.kts
16
+ @@ -57 +57 @@
17
+ - apiVersion.set(KotlinVersion.KOTLIN_2_0)
18
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
19
+ diff --git a/shared-testutil/build.gradle.kts b/shared-testutil/build.gradle.kts
20
+ --- a/shared-testutil/build.gradle.kts
21
+ +++ b/shared-testutil/build.gradle.kts
22
+ @@ -30 +30 @@
23
+ - apiVersion.set(KotlinVersion.KOTLIN_2_0)
24
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)
25
+ diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts
26
+ --- a/shared/build.gradle.kts
27
+ +++ b/shared/build.gradle.kts
28
+ @@ -36 +36 @@
29
+ - apiVersion.set(KotlinVersion.KOTLIN_2_0)
30
+ + apiVersion.set(KotlinVersion.KOTLIN_2_4)