Commit 060ca300 authored by zhuchuanyong's avatar zhuchuanyong

feat: 打包

parent c95592fc
API_URL=http://dev.vtstar.net/ API_URL=http://dev.vtstar.net/
APP_NAME=RN-开发 APP_NAME='RN-开发'
\ No newline at end of file APP_ID=com.vtrndev
VERSIONCODE=1
VERSIONNAME=1.0.0
\ No newline at end of file
API_URL=http://pro.vtstar.net/ API_URL=http://pro.vtstar.net/
APP_NAME=RN-生产 APP_NAME='RN-生产'
\ No newline at end of file APP_ID=com.vtrnpro
VERSIONCODE=1
VERSIONNAME=1.0.0
\ No newline at end of file
API_URL=http://test.vtstar.net/ API_URL=http://test.vtstar.net/
APP_NAME=RN-test APP_NAME='RN-test'
\ No newline at end of file APP_ID=com.vtrntest
VERSIONCODE=1
VERSIONNAME=1.0.0
\ No newline at end of file
...@@ -129,11 +129,13 @@ android { ...@@ -129,11 +129,13 @@ android {
} }
defaultConfig { defaultConfig {
applicationId "com.vtrnprestudy" applicationId project.env.get('APP_ID')
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode project.env.get('VERSIONCODE').toInteger()
versionName "1.0" versionName project.env.get('VERSIONNAME')
resValue "string", "build_config_package", "com.vtrnprestudy"
} }
splits { splits {
abi { abi {
......
<resources> <resources>
<string name="app_name">VtRnPreStudy</string> <string name="app_name">@string/APP_NAME</string>
</resources> </resources>
...@@ -4,11 +4,16 @@ ...@@ -4,11 +4,16 @@
"private": true, "private": true,
"scripts": { "scripts": {
"android": "react-native run-android", "android": "react-native run-android",
"android:test": "SET ENVFILE=.env.test && react-native run-android",
"android:pro": "SET ENVFILE=.env.production && react-native run-android",
"ios": "react-native run-ios", "ios": "react-native run-ios",
"start": "react-native start", "start": "react-native start",
"test": "jest", "test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx", "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"icon": "node ./src/script/iconScript.js" "icon": "node ./src/script/iconScript.js",
"build": "cd android && gradlew assembleRelease",
"build:test": "cd android && SET ENVFILE=.env.test && gradlew assembleRelease",
"build:pro": "cd android && SET ENVFILE=.env.production && gradlew assembleRelease"
}, },
"dependencies": { "dependencies": {
"@ant-design/react-native": "^4.0.7", "@ant-design/react-native": "^4.0.7",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhuchuanyong * @Author: zhuchuanyong
* @Date: 2021-01-25 14:44:12 * @Date: 2021-01-25 14:44:12
* @LastEditors: zhuchuanyong * @LastEditors: zhuchuanyong
* @LastEditTime: 2021-01-29 11:04:17 * @LastEditTime: 2021-01-30 00:00:12
* @FilePath: \src\views\Home.js * @FilePath: \src\views\Home.js
*/ */
import {Button} from '@ant-design/react-native'; import {Button} from '@ant-design/react-native';
...@@ -23,7 +23,10 @@ const Home = (props) => { ...@@ -23,7 +23,10 @@ const Home = (props) => {
<> <>
<View> <View>
<Text>{Config.API_URL}</Text> <Text>{Config.API_URL}</Text>
<Text>{Config.APP_NAME}</Text>
<Text>{Config.APP_ID}</Text>
<Text>{Config.VERSION_NAME}</Text> <Text>{Config.VERSION_NAME}</Text>
<Text>{Config.VERSIONCODE}</Text>
</View> </View>
<Button type="primary" onPress={() => gotoDetail()}> <Button type="primary" onPress={() => gotoDetail()}>
Home Home
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment