expo-targets 0.1.0 → 0.1.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.
- package/build/src/Target.d.ts +1 -0
- package/build/src/Target.d.ts.map +1 -1
- package/package.json +1 -1
- package/build/plugin/src/android/config-plugins/withAndroidColors.d.ts +0 -7
- package/build/plugin/src/android/config-plugins/withAndroidColors.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidColors.js +0 -56
- package/build/plugin/src/android/config-plugins/withAndroidColors.js.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidManifest.d.ts +0 -7
- package/build/plugin/src/android/config-plugins/withAndroidManifest.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidManifest.js +0 -70
- package/build/plugin/src/android/config-plugins/withAndroidManifest.js.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidModule.d.ts +0 -7
- package/build/plugin/src/android/config-plugins/withAndroidModule.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidModule.js +0 -41
- package/build/plugin/src/android/config-plugins/withAndroidModule.js.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidResources.d.ts +0 -7
- package/build/plugin/src/android/config-plugins/withAndroidResources.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidResources.js +0 -75
- package/build/plugin/src/android/config-plugins/withAndroidResources.js.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidTarget.d.ts +0 -28
- package/build/plugin/src/android/config-plugins/withAndroidTarget.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withAndroidTarget.js +0 -28
- package/build/plugin/src/android/config-plugins/withAndroidTarget.js.map +0 -1
- package/build/plugin/src/android/config-plugins/withGradleModule.d.ts +0 -7
- package/build/plugin/src/android/config-plugins/withGradleModule.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withGradleModule.js +0 -86
- package/build/plugin/src/android/config-plugins/withGradleModule.js.map +0 -1
- package/build/plugin/src/android/config-plugins/withGradleSettings.d.ts +0 -7
- package/build/plugin/src/android/config-plugins/withGradleSettings.d.ts.map +0 -1
- package/build/plugin/src/android/config-plugins/withGradleSettings.js +0 -23
- package/build/plugin/src/android/config-plugins/withGradleSettings.js.map +0 -1
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.d.ts +0 -3
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.d.ts.map +0 -1
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.js +0 -24
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.js.map +0 -1
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.d.ts +0 -3
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.d.ts.map +0 -1
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.js +0 -27
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.js.map +0 -1
package/build/src/Target.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Target.d.ts","sourceRoot":"","sources":["../../src/Target.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAA8B,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACzC,OAAO,CAAC,C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C/C,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACvC,uBAAuB,CAAC;AAC3B,wBAAgB,YAAY,CAC1B,CAAC,SAAS,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC,EAExD,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACvC,eAAe,CAAC;AACnB,wBAAgB,YAAY,CAC1B,CAAC,SAAS,OAAO,CAAC,aAAa,EAAE,yBAAyB,CAAC,EAE3D,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACvC,kBAAkB,CAAC;AACtB,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACvC,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { AndroidTargetOptions } from './withAndroidTarget';
|
|
3
|
-
/**
|
|
4
|
-
* Generates color resources for Android
|
|
5
|
-
*/
|
|
6
|
-
export declare const withAndroidColors: ConfigPlugin<AndroidTargetOptions>;
|
|
7
|
-
//# sourceMappingURL=withAndroidColors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidColors.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,oBAAoB,CAsChE,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withAndroidColors = void 0;
|
|
7
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
/**
|
|
11
|
-
* Generates color resources for Android
|
|
12
|
-
*/
|
|
13
|
-
const withAndroidColors = (config, options) => {
|
|
14
|
-
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
15
|
-
'android',
|
|
16
|
-
async (config) => {
|
|
17
|
-
const { platformProjectRoot } = config.modRequest;
|
|
18
|
-
const { name, colors } = options;
|
|
19
|
-
if (!colors || Object.keys(colors).length === 0) {
|
|
20
|
-
return config;
|
|
21
|
-
}
|
|
22
|
-
const modulePath = path_1.default.join(platformProjectRoot, name);
|
|
23
|
-
const resPath = path_1.default.join(modulePath, 'src', 'main', 'res');
|
|
24
|
-
// Create res/values directory
|
|
25
|
-
const valuesPath = path_1.default.join(resPath, 'values');
|
|
26
|
-
fs_1.default.mkdirSync(valuesPath, { recursive: true });
|
|
27
|
-
// Create res/values-night directory
|
|
28
|
-
const valuesNightPath = path_1.default.join(resPath, 'values-night');
|
|
29
|
-
fs_1.default.mkdirSync(valuesNightPath, { recursive: true });
|
|
30
|
-
// Generate light colors
|
|
31
|
-
const lightColorsPath = path_1.default.join(valuesPath, 'colors.xml');
|
|
32
|
-
const lightColorsContent = generateColorsXml(colors, 'light');
|
|
33
|
-
fs_1.default.writeFileSync(lightColorsPath, lightColorsContent, 'utf-8');
|
|
34
|
-
// Generate dark colors
|
|
35
|
-
const darkColorsPath = path_1.default.join(valuesNightPath, 'colors.xml');
|
|
36
|
-
const darkColorsContent = generateColorsXml(colors, 'dark');
|
|
37
|
-
fs_1.default.writeFileSync(darkColorsPath, darkColorsContent, 'utf-8');
|
|
38
|
-
return config;
|
|
39
|
-
},
|
|
40
|
-
]);
|
|
41
|
-
};
|
|
42
|
-
exports.withAndroidColors = withAndroidColors;
|
|
43
|
-
function generateColorsXml(colors, mode) {
|
|
44
|
-
const colorEntries = Object.entries(colors)
|
|
45
|
-
.map(([name, value]) => {
|
|
46
|
-
const colorValue = value[mode];
|
|
47
|
-
return ` <color name="${name}">${colorValue}</color>`;
|
|
48
|
-
})
|
|
49
|
-
.join('\n');
|
|
50
|
-
return `<?xml version="1.0" encoding="utf-8"?>
|
|
51
|
-
<resources>
|
|
52
|
-
${colorEntries}
|
|
53
|
-
</resources>
|
|
54
|
-
`;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=withAndroidColors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidColors.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidColors.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAsE;AACtE,4CAAoB;AACpB,gDAAwB;AAIxB;;GAEG;AACI,MAAM,iBAAiB,GAAuC,CACnE,MAAM,EACN,OAAO,EACP,EAAE;IACF,OAAO,IAAA,iCAAgB,EAAC,MAAM,EAAE;QAC9B,SAAS;QACT,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;YAClD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAEjC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAChD,OAAO,MAAM,CAAC;YAChB,CAAC;YAED,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;YACxD,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,E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AI,KAAK,UAAU,UAAU,CAAC;IAC3D,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;;EAEP,YAAY;;CAEb,CAAC;AACF,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { AndroidTargetOptions } from './withAndroidTarget';
|
|
3
|
-
/**
|
|
4
|
-
* Adds widget receiver to AndroidManifest.xml
|
|
5
|
-
*/
|
|
6
|
-
export declare const withAndroidManifest: ConfigPlugin<AndroidTargetOptions>;
|
|
7
|
-
//# sourceMappingURL=withAndroidManifest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidManifest.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,oBAAoB,CAqFlE,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withAndroidManifest = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
/**
|
|
6
|
-
* Adds widget receiver to AndroidManifest.xml
|
|
7
|
-
*/
|
|
8
|
-
const withAndroidManifest = (config, options) => {
|
|
9
|
-
return (0, config_plugins_1.withAndroidManifest)(config, async (config) => {
|
|
10
|
-
const { modResults } = config;
|
|
11
|
-
const { type, packageName, displayName, updatePeriodMillis = 1800000, resizeMode = 'horizontal|vertical', widgetCategory = 'home_screen', permissions = [], } = options;
|
|
12
|
-
if (type !== 'widget') {
|
|
13
|
-
return config;
|
|
14
|
-
}
|
|
15
|
-
// Get main application element
|
|
16
|
-
const mainApplication = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(modResults);
|
|
17
|
-
// Widget receiver class name
|
|
18
|
-
const receiverName = `${packageName}.${options.name}Receiver`;
|
|
19
|
-
// Check if receiver already exists
|
|
20
|
-
const existingReceiver = mainApplication.receiver?.find((r) => r.$?.['android:name'] === receiverName);
|
|
21
|
-
if (!existingReceiver) {
|
|
22
|
-
// Add receiver
|
|
23
|
-
if (!mainApplication.receiver) {
|
|
24
|
-
mainApplication.receiver = [];
|
|
25
|
-
}
|
|
26
|
-
mainApplication.receiver.push({
|
|
27
|
-
$: {
|
|
28
|
-
'android:name': receiverName,
|
|
29
|
-
'android:exported': 'false',
|
|
30
|
-
},
|
|
31
|
-
'intent-filter': [
|
|
32
|
-
{
|
|
33
|
-
action: [
|
|
34
|
-
{
|
|
35
|
-
$: {
|
|
36
|
-
'android:name': 'android.appwidget.action.APPWIDGET_UPDATE',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
'meta-data': [
|
|
43
|
-
{
|
|
44
|
-
$: {
|
|
45
|
-
'android:name': 'android.appwidget.provider',
|
|
46
|
-
'android:resource': `@xml/${options.name.toLowerCase()}_info`,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
// Add permissions if any
|
|
53
|
-
if (permissions.length > 0) {
|
|
54
|
-
if (!modResults.manifest['uses-permission']) {
|
|
55
|
-
modResults.manifest['uses-permission'] = [];
|
|
56
|
-
}
|
|
57
|
-
permissions.forEach((permission) => {
|
|
58
|
-
const existing = modResults.manifest['uses-permission']?.find((p) => p.$?.['android:name'] === permission);
|
|
59
|
-
if (!existing) {
|
|
60
|
-
modResults.manifest['uses-permission'].push({
|
|
61
|
-
$: { 'android:name': permission },
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return config;
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
exports.withAndroidManifest = withAndroidManifest;
|
|
70
|
-
//# sourceMappingURL=withAndroidManifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidManifest.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidManifest.ts"],"names":[],"mappings":";;;AAAA,yDAI8B;AAI9B;;GAEG;AACI,MAAM,mBAAmB,GAAuC,CACrE,MAAM,EACN,OAAO,EACP,EAAE;IACF,OAAO,IAAA,oCAAuB,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACtD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,MAAM,EACJ,IAAI,EACJ,WAAW,EACX,WAAW,EACX,kBAAkB,GAAG,OAAO,EAC5B,UAAU,GAAG,qBAAqB,EAClC,cAAc,GAAG,aAAa,EAC9B,WAAW,GAAG,EAAE,GACjB,GAAG,OAAO,CAAC;QAEZ,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,+BAA+B;QAC/B,MAAM,eAAe,GAAG,8BAAa,CAAC,QAAQ,CAAC,yBAAyB,CACtE,UAAU,CACX,CAAC;QAEF,6BAA6B;QAC7B,MAAM,YAAY,GAAG,GAAG,WAAW,IAAI,OAAO,CAAC,IAAI,UAAU,CAAC;QAE9D,mCAAmC;QACnC,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,EAAE,IAAI,CACrD,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,KAAK,YAAY,CACnD,CAAC;QAEF,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,eAAe;YACf,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;gBAC9B,eAAe,CAAC,QAAQ,GAAG,EAAE,CAAC;YA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0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { AndroidTargetOptions } from './withAndroidTarget';
|
|
3
|
-
/**
|
|
4
|
-
* Copies Android source files from targets directory to android module
|
|
5
|
-
*/
|
|
6
|
-
export declare const withAndroidModule: ConfigPlugin<AndroidTargetOptions>;
|
|
7
|
-
//# sourceMappingURL=withAndroidModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidModule.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,oBAAoB,CAwChE,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withAndroidModule = void 0;
|
|
7
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
/**
|
|
11
|
-
* Copies Android source files from targets directory to android module
|
|
12
|
-
*/
|
|
13
|
-
const withAndroidModule = (config, options) => {
|
|
14
|
-
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
15
|
-
'android',
|
|
16
|
-
async (config) => {
|
|
17
|
-
const { platformProjectRoot, projectRoot } = config.modRequest;
|
|
18
|
-
const { name, packageName, directory } = options;
|
|
19
|
-
const modulePath = path_1.default.join(platformProjectRoot, name);
|
|
20
|
-
const srcPath = path_1.default.join(modulePath, 'src', 'main', 'kotlin', ...packageName.split('.'));
|
|
21
|
-
// Ensure source directory exists
|
|
22
|
-
fs_1.default.mkdirSync(srcPath, { recursive: true });
|
|
23
|
-
// Source directory in targets
|
|
24
|
-
const targetAndroidDir = path_1.default.join(projectRoot, directory, 'android');
|
|
25
|
-
// Copy Kotlin files if they exist
|
|
26
|
-
if (fs_1.default.existsSync(targetAndroidDir)) {
|
|
27
|
-
const files = fs_1.default.readdirSync(targetAndroidDir);
|
|
28
|
-
files.forEach((file) => {
|
|
29
|
-
if (file.endsWith('.kt')) {
|
|
30
|
-
const sourcePath = path_1.default.join(targetAndroidDir, file);
|
|
31
|
-
const destPath = path_1.default.join(srcPath, file);
|
|
32
|
-
fs_1.default.copyFileSync(sourcePath, destPath);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return config;
|
|
37
|
-
},
|
|
38
|
-
]);
|
|
39
|
-
};
|
|
40
|
-
exports.withAndroidModule = withAndroidModule;
|
|
41
|
-
//# sourceMappingURL=withAndroidModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidModule.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidModule.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAsE;AACtE,4CAAoB;AACpB,gDAAwB;AAIxB;;GAEG;AACI,MAAM,iBAAiB,GAAuC,CACnE,MAAM,EACN,OAAO,EACP,EAAE;IACF,OAAO,IAAA,iCAAgB,EAAC,MAAM,EAAE;QAC9B,SAAS;QACT,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;YAC/D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;YAEjD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;YACxD,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CACvB,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,EACR,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAC1B,CAAC;YAEF,iCAAiC;YACjC,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAE3C,8BAA8B;YAC9B,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YAEtE,kCAAkC;YAClC,IAAI,YAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACpC,MAAM,KAAK,GAAG,YAAE,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;gBAC/C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrB,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;wBACzB,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;wBACrD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;wBAC1C,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;oBACxC,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAxCW,QAAA,iBAAiB,qBAwC5B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { AndroidTargetOptions } from './withAndroidTarget';
|
|
3
|
-
/**
|
|
4
|
-
* Generates Android resources (XML files for widgets)
|
|
5
|
-
*/
|
|
6
|
-
export declare const withAndroidResources: ConfigPlugin<AndroidTargetOptions>;
|
|
7
|
-
//# sourceMappingURL=withAndroidResources.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidResources.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,oBAAoB,CAwDnE,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withAndroidResources = void 0;
|
|
7
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
/**
|
|
11
|
-
* Generates Android resources (XML files for widgets)
|
|
12
|
-
*/
|
|
13
|
-
const withAndroidResources = (config, options) => {
|
|
14
|
-
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
15
|
-
'android',
|
|
16
|
-
async (config) => {
|
|
17
|
-
const { platformProjectRoot } = config.modRequest;
|
|
18
|
-
const { name, type, updatePeriodMillis = 1800000, resizeMode = 'horizontal|vertical', widgetCategory = 'home_screen', displayName, } = options;
|
|
19
|
-
const modulePath = path_1.default.join(platformProjectRoot, name);
|
|
20
|
-
const resPath = path_1.default.join(modulePath, 'src', 'main', 'res');
|
|
21
|
-
if (type === 'widget') {
|
|
22
|
-
// Create res/xml directory
|
|
23
|
-
const xmlPath = path_1.default.join(resPath, 'xml');
|
|
24
|
-
fs_1.default.mkdirSync(xmlPath, { recursive: true });
|
|
25
|
-
// Generate widget info XML
|
|
26
|
-
const widgetInfoPath = path_1.default.join(xmlPath, `${name.toLowerCase()}_info.xml`);
|
|
27
|
-
const widgetInfoContent = generateWidgetInfo({
|
|
28
|
-
updatePeriodMillis,
|
|
29
|
-
resizeMode,
|
|
30
|
-
widgetCategory,
|
|
31
|
-
description: displayName || name,
|
|
32
|
-
});
|
|
33
|
-
fs_1.default.writeFileSync(widgetInfoPath, widgetInfoContent, 'utf-8');
|
|
34
|
-
// Create res/values directory for strings
|
|
35
|
-
const valuesPath = path_1.default.join(resPath, 'values');
|
|
36
|
-
fs_1.default.mkdirSync(valuesPath, { recursive: true });
|
|
37
|
-
// Generate strings.xml
|
|
38
|
-
const stringsPath = path_1.default.join(valuesPath, 'strings.xml');
|
|
39
|
-
if (!fs_1.default.existsSync(stringsPath)) {
|
|
40
|
-
const stringsContent = generateStrings({
|
|
41
|
-
name,
|
|
42
|
-
description: displayName || name,
|
|
43
|
-
});
|
|
44
|
-
fs_1.default.writeFileSync(stringsPath, stringsContent, 'utf-8');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return config;
|
|
48
|
-
},
|
|
49
|
-
]);
|
|
50
|
-
};
|
|
51
|
-
exports.withAndroidResources = withAndroidResources;
|
|
52
|
-
function generateWidgetInfo(options) {
|
|
53
|
-
const { updatePeriodMillis, resizeMode, widgetCategory, description } = options;
|
|
54
|
-
return `<?xml version="1.0" encoding="utf-8"?>
|
|
55
|
-
<appwidget-provider
|
|
56
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
57
|
-
android:minWidth="180dp"
|
|
58
|
-
android:minHeight="110dp"
|
|
59
|
-
android:targetCellWidth="3"
|
|
60
|
-
android:targetCellHeight="2"
|
|
61
|
-
android:updatePeriodMillis="${updatePeriodMillis}"
|
|
62
|
-
android:resizeMode="${resizeMode}"
|
|
63
|
-
android:widgetCategory="${widgetCategory}"
|
|
64
|
-
android:description="@string/widget_description" />
|
|
65
|
-
`;
|
|
66
|
-
}
|
|
67
|
-
function generateStrings(options) {
|
|
68
|
-
const { description } = options;
|
|
69
|
-
return `<?xml version="1.0" encoding="utf-8"?>
|
|
70
|
-
<resources>
|
|
71
|
-
<string name="widget_description">${description}</string>
|
|
72
|
-
</resources>
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=withAndroidResources.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidResources.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidResources.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAsE;AACtE,4CAAoB;AACpB,gDAAwB;AAIxB;;GAEG;AACI,MAAM,oBAAoB,GAAuC,CACtE,MAAM,EACN,OAAO,EACP,EAAE;IACF,OAAO,IAAA,iCAAgB,EAAC,MAAM,EAAE;QAC9B,SAAS;QACT,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;YAClD,MAAM,EACJ,IAAI,EACJ,IAAI,EACJ,kBAAkB,GAAG,OAAO,EAC5B,UAAU,GAAG,qBAAqB,EAClC,cAAc,GAAG,aAAa,EAC9B,WAAW,GACZ,GAAG,OAAO,CAAC;YAEZ,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;YACxD,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YAE5D,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACtB,2BAA2B;gBAC3B,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC1C,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAE3C,2BAA2B;gBAC3B,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAC9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WAAW;;CAElD,CAAC;AACF,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { Logger } from '../../logger';
|
|
3
|
-
export interface AndroidTargetOptions {
|
|
4
|
-
type: string;
|
|
5
|
-
name: string;
|
|
6
|
-
displayName?: string;
|
|
7
|
-
packageName: string;
|
|
8
|
-
directory: string;
|
|
9
|
-
configPath: string;
|
|
10
|
-
logger: Logger;
|
|
11
|
-
colors?: Record<string, {
|
|
12
|
-
light: string;
|
|
13
|
-
dark: string;
|
|
14
|
-
}>;
|
|
15
|
-
minSdkVersion?: number;
|
|
16
|
-
targetSdkVersion?: number;
|
|
17
|
-
updatePeriodMillis?: number;
|
|
18
|
-
resizeMode?: string;
|
|
19
|
-
widgetCategory?: string;
|
|
20
|
-
useGlance?: boolean;
|
|
21
|
-
permissions?: string[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Main orchestrator for Android target configuration
|
|
25
|
-
* Applies all necessary modifications for a single target
|
|
26
|
-
*/
|
|
27
|
-
export declare const withAndroidTarget: ConfigPlugin<AndroidTargetOptions>;
|
|
28
|
-
//# sourceMappingURL=withAndroidTarget.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidTarget.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQtC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,oBAAoB,CAmBhE,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withAndroidTarget = void 0;
|
|
4
|
-
const withAndroidColors_1 = require("./withAndroidColors");
|
|
5
|
-
const withAndroidManifest_1 = require("./withAndroidManifest");
|
|
6
|
-
const withAndroidModule_1 = require("./withAndroidModule");
|
|
7
|
-
const withAndroidResources_1 = require("./withAndroidResources");
|
|
8
|
-
const withGradleModule_1 = require("./withGradleModule");
|
|
9
|
-
const withGradleSettings_1 = require("./withGradleSettings");
|
|
10
|
-
/**
|
|
11
|
-
* Main orchestrator for Android target configuration
|
|
12
|
-
* Applies all necessary modifications for a single target
|
|
13
|
-
*/
|
|
14
|
-
const withAndroidTarget = (config, options) => {
|
|
15
|
-
const { logger, name, type } = options;
|
|
16
|
-
logger.log(`Configuring Android target: ${name} (${type})`);
|
|
17
|
-
// Apply plugins in order
|
|
18
|
-
config = (0, withGradleSettings_1.withGradleSettings)(config, options);
|
|
19
|
-
config = (0, withGradleModule_1.withGradleModule)(config, options);
|
|
20
|
-
config = (0, withAndroidModule_1.withAndroidModule)(config, options);
|
|
21
|
-
config = (0, withAndroidResources_1.withAndroidResources)(config, options);
|
|
22
|
-
config = (0, withAndroidColors_1.withAndroidColors)(config, options);
|
|
23
|
-
config = (0, withAndroidManifest_1.withAndroidManifest)(config, options);
|
|
24
|
-
logger.logSparse(true, `Configured target | ${options.displayName || name}`);
|
|
25
|
-
return config;
|
|
26
|
-
};
|
|
27
|
-
exports.withAndroidTarget = withAndroidTarget;
|
|
28
|
-
//# sourceMappingURL=withAndroidTarget.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidTarget.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withAndroidTarget.ts"],"names":[],"mappings":";;;AAGA,2DAAwD;AACxD,+DAA4D;AAC5D,2DAAwD;AACxD,iEAA8D;AAC9D,yDAAsD;AACtD,6DAA0D;AAoB1D;;;GAGG;AACI,MAAM,iBAAiB,GAAuC,CACnE,MAAM,EACN,OAAO,EACP,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,CAAC,GAAG,CAAC,+BAA+B,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;IAE5D,yBAAyB;IACzB,MAAM,GAAG,IAAA,uCAAkB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,GAAG,IAAA,mCAAgB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,GAAG,IAAA,qCAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,GAAG,IAAA,2CAAoB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,MAAM,GAAG,IAAA,qCAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,GAAG,IAAA,yCAAmB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE9C,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,uBAAuB,OAAO,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC,CAAC;IAE7E,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAnBW,QAAA,iBAAiB,qBAmB5B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { AndroidTargetOptions } from './withAndroidTarget';
|
|
3
|
-
/**
|
|
4
|
-
* Generates build.gradle for the target module
|
|
5
|
-
*/
|
|
6
|
-
export declare const withGradleModule: ConfigPlugin<AndroidTargetOptions>;
|
|
7
|
-
//# sourceMappingURL=withGradleModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withGradleModule.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withGradleModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,oBAAoB,CAoC/D,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withGradleModule = void 0;
|
|
7
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
/**
|
|
11
|
-
* Generates build.gradle for the target module
|
|
12
|
-
*/
|
|
13
|
-
const withGradleModule = (config, options) => {
|
|
14
|
-
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
15
|
-
'android',
|
|
16
|
-
async (config) => {
|
|
17
|
-
const { platformProjectRoot } = config.modRequest;
|
|
18
|
-
const { name, packageName, minSdkVersion = 26, targetSdkVersion = 34, useGlance = true, type, } = options;
|
|
19
|
-
const modulePath = path_1.default.join(platformProjectRoot, name);
|
|
20
|
-
const buildGradlePath = path_1.default.join(modulePath, 'build.gradle');
|
|
21
|
-
// Ensure module directory exists
|
|
22
|
-
fs_1.default.mkdirSync(modulePath, { recursive: true });
|
|
23
|
-
const buildGradleContent = generateBuildGradle({
|
|
24
|
-
packageName,
|
|
25
|
-
minSdkVersion,
|
|
26
|
-
targetSdkVersion,
|
|
27
|
-
useGlance,
|
|
28
|
-
type,
|
|
29
|
-
});
|
|
30
|
-
fs_1.default.writeFileSync(buildGradlePath, buildGradleContent, 'utf-8');
|
|
31
|
-
return config;
|
|
32
|
-
},
|
|
33
|
-
]);
|
|
34
|
-
};
|
|
35
|
-
exports.withGradleModule = withGradleModule;
|
|
36
|
-
function generateBuildGradle(options) {
|
|
37
|
-
const { packageName, minSdkVersion, targetSdkVersion, useGlance, type } = options;
|
|
38
|
-
const isWidget = type === 'widget';
|
|
39
|
-
const needsCompose = isWidget && useGlance;
|
|
40
|
-
return `plugins {
|
|
41
|
-
id 'com.android.library'
|
|
42
|
-
id 'org.jetbrains.kotlin.android'
|
|
43
|
-
${needsCompose ? "id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.20'" : ''}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
android {
|
|
47
|
-
namespace '${packageName}'
|
|
48
|
-
compileSdk ${targetSdkVersion}
|
|
49
|
-
|
|
50
|
-
defaultConfig {
|
|
51
|
-
minSdk ${minSdkVersion}
|
|
52
|
-
targetSdk ${targetSdkVersion}
|
|
53
|
-
}
|
|
54
|
-
${needsCompose
|
|
55
|
-
? `
|
|
56
|
-
buildFeatures {
|
|
57
|
-
compose true
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
composeOptions {
|
|
61
|
-
kotlinCompilerExtensionVersion '1.5.3'
|
|
62
|
-
}
|
|
63
|
-
`
|
|
64
|
-
: ''}
|
|
65
|
-
kotlinOptions {
|
|
66
|
-
jvmTarget = '1.8'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
dependencies {
|
|
71
|
-
implementation project(':app')
|
|
72
|
-
${isWidget && useGlance
|
|
73
|
-
? `
|
|
74
|
-
// Glance for modern widgets
|
|
75
|
-
implementation 'androidx.glance:glance-appwidget:1.0.0'
|
|
76
|
-
implementation 'androidx.compose.runtime:runtime:1.5.4'
|
|
77
|
-
implementation 'androidx.compose.ui:ui:1.5.4'
|
|
78
|
-
|
|
79
|
-
// Kotlin serialization for JSON parsing
|
|
80
|
-
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0'
|
|
81
|
-
`
|
|
82
|
-
: ''}
|
|
83
|
-
}
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=withGradleModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withGradleModule.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withGradleModule.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAsE;AACtE,4CAAoB;AACpB,gDAAwB;AAIxB;;GAEG;AACI,MAAM,gBAAgB,GAAuC,CAClE,MAAM,EACN,OAAO,EACP,EAAE;IACF,OAAO,IAAA,iCAAgB,EAAC,MAAM,EAAE;QAC9B,SAAS;QACT,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;YAClD,MAAM,EACJ,IAAI,EACJ,WAAW,EACX,aAAa,GAAG,EAAE,EAClB,gBAAgB,GAAG,EAAE,EACrB,SAAS,GAAG,IAAI,EAChB,IAAI,GACL,GAAG,OAAO,CAAC;YAEZ,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;YACxD,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAE9D,iCAAiC;YACjC,YAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAE9C,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;gBAC7C,WAAW;gBACX,aAAa;gBACb,gBAAgB;gBAChB,SAAS;gBACT,IAAI;aACL,CAAC,CAAC;YAEH,YAAE,CAAC,aAAa,CAAC,eAAe,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;YAE/D,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AApCW,QAAA,gBAAgB,oBAoC3B;AAEF,SAAS,mBAAmB,CAAC,OAM5B;IACC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,GACrE,OAAO,CAAC;IAEV,MAAM,QAAQ,GAAG,IAAI,KAAK,QAAQ,CAAC;IACnC,MAAM,YAAY,GAAG,QAAQ,IAAI,SAAS,CAAC;IAE3C,OAAO;;;MAGH,YAAY,CAAC,CAAC,CAAC,iEAAiE,CAAC,CAAC,CAAC,EAAE;;;;iBAI1E,WAAW;iBACX,gBAAgB;;;iBAGhB,aAAa;oBACV,gBAAgB;;EAGlC,YAAY;QACV,CAAC,CAAC;;;;;;;;CAQL;QACG,CAAC,CAAC,EACN;;;;;;;;MASM,QAAQ,IAAI,SAAS;QACnB,CAAC,CAAC;;;;;;;;KAQL;QACG,CAAC,CAAC,EACN;;CAEH,CAAC;AACF,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { AndroidTargetOptions } from './withAndroidTarget';
|
|
3
|
-
/**
|
|
4
|
-
* Adds target module to settings.gradle
|
|
5
|
-
*/
|
|
6
|
-
export declare const withGradleSettings: ConfigPlugin<AndroidTargetOptions>;
|
|
7
|
-
//# sourceMappingURL=withGradleSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withGradleSettings.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withGradleSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,oBAAoB,CAmBjE,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withGradleSettings = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
/**
|
|
6
|
-
* Adds target module to settings.gradle
|
|
7
|
-
*/
|
|
8
|
-
const withGradleSettings = (config, options) => {
|
|
9
|
-
return (0, config_plugins_1.withSettingsGradle)(config, (config) => {
|
|
10
|
-
const { modResults } = config;
|
|
11
|
-
const { name } = options;
|
|
12
|
-
const moduleInclude = `include ':${name}'`;
|
|
13
|
-
const projectDir = `project(':${name}').projectDir = new File(rootProject.projectDir, '${name}')`;
|
|
14
|
-
// Check if already added
|
|
15
|
-
if (!modResults.contents.includes(moduleInclude)) {
|
|
16
|
-
// Add at the end
|
|
17
|
-
modResults.contents += `\n// Added by expo-targets\n${moduleInclude}\n${projectDir}\n`;
|
|
18
|
-
}
|
|
19
|
-
return config;
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
exports.withGradleSettings = withGradleSettings;
|
|
23
|
-
//# sourceMappingURL=withGradleSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withGradleSettings.js","sourceRoot":"","sources":["../../../../../plugin/src/android/config-plugins/withGradleSettings.ts"],"names":[],"mappings":";;;AAAA,yDAAwE;AAIxE;;GAEG;AACI,MAAM,kBAAkB,GAAuC,CACpE,MAAM,EACN,OAAO,EACP,EAAE;IACF,OAAO,IAAA,mCAAkB,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAEzB,MAAM,aAAa,GAAG,aAAa,IAAI,GAAG,CAAC;QAC3C,MAAM,UAAU,GAAG,aAAa,IAAI,qDAAqD,IAAI,IAAI,CAAC;QAElG,yBAAyB;QACzB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YACjD,iBAAiB;YACjB,UAAU,CAAC,QAAQ,IAAI,+BAA+B,aAAa,KAAK,UAAU,IAAI,CAAC;QACzF,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,kBAAkB,sBAmB7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidKotlinGradleProperty.d.ts","sourceRoot":"","sources":["../../../../plugin/src/android/withAndroidKotlinGradleProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,+BAA+B,EAAE,YAoB7C,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withAndroidKotlinGradleProperty = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const REQUIRED_KOTLIN_VERSION = '2.0.21';
|
|
6
|
-
const withAndroidKotlinGradleProperty = (config) => {
|
|
7
|
-
return (0, config_plugins_1.withGradleProperties)(config, (gradleConfig) => {
|
|
8
|
-
const propertyName = 'android.kotlinVersion';
|
|
9
|
-
const existingProperty = gradleConfig.modResults.find((property) => property.type === 'property' && property.key === propertyName);
|
|
10
|
-
if (existingProperty) {
|
|
11
|
-
existingProperty.value = REQUIRED_KOTLIN_VERSION;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
gradleConfig.modResults.push({
|
|
15
|
-
type: 'property',
|
|
16
|
-
key: propertyName,
|
|
17
|
-
value: REQUIRED_KOTLIN_VERSION,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return gradleConfig;
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.withAndroidKotlinGradleProperty = withAndroidKotlinGradleProperty;
|
|
24
|
-
//# sourceMappingURL=withAndroidKotlinGradleProperty.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidKotlinGradleProperty.js","sourceRoot":"","sources":["../../../../plugin/src/android/withAndroidKotlinGradleProperty.ts"],"names":[],"mappings":";;;AAAA,yDAG8B;AAE9B,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAElC,MAAM,+BAA+B,GAAiB,CAAC,MAAM,EAAE,EAAE;IACtE,OAAO,IAAA,qCAAoB,EAAC,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;QACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;QAC7C,MAAM,gBAAgB,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CACnD,CAAC,QAAQ,EAAgE,EAAE,CACzE,QAAQ,CAAC,IAAI,KAAK,UAAU,IAAI,QAAQ,CAAC,GAAG,KAAK,YAAY,CAChE,CAAC;QAEF,IAAI,gBAAgB,EAAE,CAAC;YACrB,gBAAgB,CAAC,KAAK,GAAG,uBAAuB,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC;gBAC3B,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,uBAAuB;aAC/B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AApBW,QAAA,+BAA+B,mCAoB1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidProjectKotlinVersion.d.ts","sourceRoot":"","sources":["../../../../plugin/src/android/withAndroidProjectKotlinVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,sBAAsB,CAAC;AAM5E,eAAO,MAAM,+BAA+B,EAAE,YA8B7C,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withAndroidProjectKotlinVersion = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const REQUIRED_KOTLIN_VERSION = '2.0.21';
|
|
6
|
-
const KOTLIN_CLASSPATH_REGEX = /(classpath\(['"]org\.jetbrains\.kotlin:kotlin-gradle-plugin)(?::[0-9A-Za-z.+-]+)?(['"]\))/;
|
|
7
|
-
const withAndroidProjectKotlinVersion = (config) => {
|
|
8
|
-
return (0, config_plugins_1.withProjectBuildGradle)(config, (gradleConfig) => {
|
|
9
|
-
const { modResults } = gradleConfig;
|
|
10
|
-
if (modResults.language !== 'groovy') {
|
|
11
|
-
return gradleConfig;
|
|
12
|
-
}
|
|
13
|
-
if (!KOTLIN_CLASSPATH_REGEX.test(modResults.contents)) {
|
|
14
|
-
return gradleConfig;
|
|
15
|
-
}
|
|
16
|
-
// Update Kotlin version
|
|
17
|
-
modResults.contents = modResults.contents.replace(KOTLIN_CLASSPATH_REGEX, (_match, prefix, suffix) => `${prefix}:${REQUIRED_KOTLIN_VERSION}${suffix}`);
|
|
18
|
-
// Add Compose Compiler plugin to buildscript dependencies for Kotlin 2.0+
|
|
19
|
-
// This is required before applying the plugin in modules
|
|
20
|
-
if (!modResults.contents.includes('org.jetbrains.kotlin.plugin.compose')) {
|
|
21
|
-
modResults.contents = modResults.contents.replace(/(dependencies\s*\{[^}]*classpath\(['"]org\.jetbrains\.kotlin:kotlin-gradle-plugin:[^'"]+['"]\))/, `$1\n classpath('org.jetbrains.kotlin:compose-compiler-gradle-plugin:${REQUIRED_KOTLIN_VERSION}')`);
|
|
22
|
-
}
|
|
23
|
-
return gradleConfig;
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.withAndroidProjectKotlinVersion = withAndroidProjectKotlinVersion;
|
|
27
|
-
//# sourceMappingURL=withAndroidProjectKotlinVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidProjectKotlinVersion.js","sourceRoot":"","sources":["../../../../plugin/src/android/withAndroidProjectKotlinVersion.ts"],"names":[],"mappings":";;;AAAA,yDAA4E;AAE5E,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AACzC,MAAM,sBAAsB,GAC1B,2FAA2F,CAAC;AAEvF,MAAM,+BAA+B,GAAiB,CAAC,MAAM,EAAE,EAAE;IACtE,OAAO,IAAA,uCAAsB,EAAC,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;QACrD,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC;QAEpC,IAAI,UAAU,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtD,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,wBAAwB;QACxB,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAC/C,sBAAsB,EACtB,CAAC,MAAM,EAAE,MAAc,EAAE,MAAc,EAAE,EAAE,CACzC,GAAG,MAAM,IAAI,uBAAuB,GAAG,MAAM,EAAE,CAClD,CAAC;QAEF,0EAA0E;QAC1E,yDAAyD;QACzD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EAAE,CAAC;YACzE,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAC/C,iGAAiG,EACjG,8EAA8E,uBAAuB,IAAI,CAC1G,CAAC;QACJ,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA9BW,QAAA,+BAA+B,mCA8B1C"}
|