codeplay-common 3.2.18 → 4.0.0

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.
@@ -19,15 +19,17 @@ const addToolAttribute=()=>{
19
19
  let manifest = fs.readFileSync(manifestPath, 'utf8');
20
20
 
21
21
  // Check if xmlns:tools exists
22
- if (!manifest.includes('xmlns:tools="http://schemas.android.com/tools"')) {
23
- // Add the tools namespace to the <manifest> tag.
24
- manifest = manifest.replace('<manifest', '<manifest xmlns:tools="http://schemas.android.com/tools"');
25
- fs.writeFileSync(manifestPath, manifest, 'utf8');
26
- console.log('✅ EMI-ADMob: Added xmlns:tools to AndroidManifest.xml');
27
- } else {
28
- console.log('ℹ️ EMI-ADMob: xmlns:tools already exists, skipping...');
29
- }
30
- }
31
- };
22
+ if (!manifest.includes('xmlns:tools="http://schemas.android.com/tools"')) {
23
+ // Add the tools namespace to the <manifest> tag.
24
+ manifest = manifest.replace('<manifest', '<manifest xmlns:tools="http://schemas.android.com/tools"');
25
+ fs.writeFileSync(manifestPath, manifest, 'utf8');
26
+ console.log('✅ Added xmlns:tools to AndroidManifest.xml');
27
+ } else {
28
+ console.log('ℹ️ xmlns:tools already exists, skipping...');
29
+ }
30
+ } else {
31
+ console.log('ℹ️ capacitor-cordova-android-plugins AndroidManifest.xml not found, skipping tools namespace update.');
32
+ }
33
+ };
32
34
 
33
35
  addToolAttribute()
@@ -1,45 +1,43 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- // Path to the plugin.xml file
5
- /* const pluginXmlPath = path.join(
6
- 'node_modules',
7
- 'emi-indo-cordova-plugin-admob',
8
- 'plugin.xml'
9
- ); */
10
-
11
-
12
- const pluginXmlPath = path.resolve(
13
- __dirname,
14
- '../node_modules/emi-indo-cordova-plugin-admob/plugin.xml'
15
- );
16
-
17
- // Read and modify the plugin.xml file
18
- fs.readFile(pluginXmlPath, 'utf8', (err, data) => {
19
- if (err) {
20
- console.error('Error reading plugin.xml:', err);
21
- process.exit(1);
22
- }
23
-
24
- // Remove force-kotlin.gradle reference line
25
- const modifiedData = data.replace(
26
- /<framework\s+src="src\/android\/force-kotlin\.gradle"\s+custom="true"\s+type="gradleReference"\s*\/>\s*\n?/g,
27
- ''
28
- );
29
-
30
- /* const modifiedData = data.replace(
31
- /<framework[^>]*force-kotlin\.gradle[^>]*\/>\s*\n?/g,
32
- ''
33
- ); */
34
-
35
-
36
- // Write back
37
- fs.writeFile(pluginXmlPath, modifiedData, 'utf8', (err) => {
38
- if (err) {
39
- console.error('Error writing plugin.xml:', err);
40
- process.exit(1);
41
- }
42
-
43
- console.log('plugin.xml updated successfully.');
44
- });
45
- });
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const legacyPluginXmlPath = path.resolve(
5
+ __dirname,
6
+ '../node_modules/emi-indo-cordova-plugin-admob/plugin.xml'
7
+ );
8
+
9
+ const nextGenPackagePath = path.resolve(
10
+ __dirname,
11
+ '../node_modules/capacitor-admob-nextgen/package.json'
12
+ );
13
+
14
+ if (!fs.existsSync(legacyPluginXmlPath)) {
15
+ if (fs.existsSync(nextGenPackagePath)) {
16
+ console.log('ℹ️ Skipping legacy Kotlin patch. capacitor-admob-nextgen is installed and does not use plugin.xml.');
17
+ process.exit(0);
18
+ }
19
+
20
+ console.log('ℹ️ Legacy AdMob plugin.xml not found, skipping Kotlin patch.');
21
+ process.exit(0);
22
+ }
23
+
24
+ fs.readFile(legacyPluginXmlPath, 'utf8', (err, data) => {
25
+ if (err) {
26
+ console.error('Error reading plugin.xml:', err);
27
+ process.exit(1);
28
+ }
29
+
30
+ const modifiedData = data.replace(
31
+ /<framework\s+src="src\/android\/force-kotlin\.gradle"\s+custom="true"\s+type="gradleReference"\s*\/>\s*\n?/g,
32
+ ''
33
+ );
34
+
35
+ fs.writeFile(legacyPluginXmlPath, modifiedData, 'utf8', (writeErr) => {
36
+ if (writeErr) {
37
+ console.error('Error writing plugin.xml:', writeErr);
38
+ process.exit(1);
39
+ }
40
+
41
+ console.log('plugin.xml updated successfully.');
42
+ });
43
+ });
@@ -3,7 +3,7 @@
3
3
  {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
4
4
  {"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.2","baseDir":"js","mandatoryUpdate":true},
5
5
 
6
- {"name":"admob-emi","pattern":"Ads[\\\\/]admob-emi-(\\d+\\.\\d+)\\.js$","minVersion":"4.1","baseDir":"js","mandatoryUpdate":true},
6
+ {"name":"admob-emi-nextgen","pattern":"Ads[\\\\/]admob-emi-nextgen-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
7
7
  {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
8
  {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
9
  {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
@@ -24,4 +24,4 @@
24
24
  {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
25
  {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
26
  ]
27
- }
27
+ }