expo-android-change-gradle-distribution-url 1.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.
- package/README.md +1 -0
- package/index.js +38 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
### 使用
|
package/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
function sayhello(name) {
|
|
3
|
+
return `hello ${name}`;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
sayhello
|
|
8
|
+
};
|
|
9
|
+
// import { withGradleProperties, type ConfigPlugin } from "@expo/config-plugins";
|
|
10
|
+
// import fs from "node:fs";
|
|
11
|
+
|
|
12
|
+
// interface WithGradleWrapperPluginProps {
|
|
13
|
+
// distributionUrl?: string;
|
|
14
|
+
// }
|
|
15
|
+
|
|
16
|
+
// const withGradleWrapperPlugin: ConfigPlugin<WithGradleWrapperPluginProps> = (
|
|
17
|
+
// expoConfig,
|
|
18
|
+
// { distributionUrl }
|
|
19
|
+
// ) => {
|
|
20
|
+
// return withGradleProperties(expoConfig, (config) => {
|
|
21
|
+
// const gradleWrapperPath = `${config.modRequest.platformProjectRoot}/gradle/wrapper/gradle-wrapper.properties`;
|
|
22
|
+
|
|
23
|
+
// const properties = fs.readFileSync(gradleWrapperPath, "utf8");
|
|
24
|
+
// if (distributionUrl) {
|
|
25
|
+
// // 修改 Gradle 版本
|
|
26
|
+
// const updated = properties.replace(
|
|
27
|
+
// /distributionUrl=.+/,
|
|
28
|
+
// `distributionUrl=${distributionUrl}`
|
|
29
|
+
// );
|
|
30
|
+
|
|
31
|
+
// fs.writeFileSync(gradleWrapperPath, updated);
|
|
32
|
+
// }
|
|
33
|
+
|
|
34
|
+
// return config;
|
|
35
|
+
// });
|
|
36
|
+
// };
|
|
37
|
+
|
|
38
|
+
// export default withGradleWrapperPlugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "expo-android-change-gradle-distribution-url",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"Expo",
|
|
8
|
+
"Android",
|
|
9
|
+
"Gradle",
|
|
10
|
+
"Distribution"
|
|
11
|
+
],
|
|
12
|
+
"author": "sunlinxi",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"description": "Expo Android Change Gradle Distribution Url",
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js"
|
|
17
|
+
],
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"prettier": "^3.7.4"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
23
|
+
"build": "node script/index.js",
|
|
24
|
+
"ci:publish": "pnpm publish --no-git-checks",
|
|
25
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
|
|
26
|
+
}
|
|
27
|
+
}
|