codeplay-common 1.4.0 → 1.4.1

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.
@@ -308,6 +308,44 @@ if (updated) {
308
308
 
309
309
 
310
310
 
311
+ // To resolve the kotlin version issue, we need to update the kotlin version in the build.gradle file START
312
+
313
+ // Build the path dynamically like you requested
314
+ const gradlePath = path.join(
315
+ process.cwd(),
316
+ 'android',
317
+ 'build.gradle'
318
+ );
319
+
320
+ // Read the existing build.gradle
321
+ let gradleContent = fs.readFileSync(gradlePath, 'utf8');
322
+
323
+ // Add `ext.kotlin_version` if it's not already there
324
+ if (!gradleContent.includes('ext.kotlin_version')) {
325
+ gradleContent = gradleContent.replace(
326
+ /buildscript\s*{/,
327
+ `buildscript {\n ext.kotlin_version = '2.1.0'`
328
+ );
329
+ }
330
+
331
+ // Add Kotlin classpath if it's not already there
332
+ if (!gradleContent.includes('org.jetbrains.kotlin:kotlin-gradle-plugin')) {
333
+ gradleContent = gradleContent.replace(
334
+ /dependencies\s*{([\s\S]*?)classpath 'com.android.tools.build:gradle:8.7.2'/,
335
+ `dependencies {\n classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")\n$1classpath 'com.android.tools.build:gradle:8.7.2'`
336
+ );
337
+ }
338
+
339
+ // Write back the modified content
340
+ fs.writeFileSync(gradlePath, gradleContent, 'utf8');
341
+
342
+ console.log('✅ Kotlin version updated in build.gradle.');
343
+
344
+ // To resolve the kotlin version issue, we need to update the kotlin version in the build.gradle file END
345
+
346
+
347
+
348
+
311
349
 
312
350
 
313
351
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",