Commit 69f5ddf 1 parent 845f5a1 commit 69f5ddf Copy full SHA for 69f5ddf
File tree 7 files changed +39
-26
lines changed
7 files changed +39
-26
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ npx upload-pgy --no-android
124
124
npx upload-pgy --no-ios
125
125
126
126
# 安卓默认打包release版本,可以改成debug版本
127
- npx upload-pgy --debug
127
+ npx upload-pgy --variant= debug
128
128
```
129
129
130
130
### fir.im
@@ -139,7 +139,7 @@ npx upload-fir --no-android
139
139
npx upload-fir --no-ios
140
140
141
141
# 安卓默认打包release版本,可以改成debug版本
142
- npx upload-fir -- debug
142
+ npx upload-fir --variant= debug
143
143
```
144
144
145
145
### App Store
@@ -164,6 +164,9 @@ npx upload-tf
164
164
### 同时打包android和ios
165
165
``` bash
166
166
npx upload-build --ios-export-plist path/to/xxx.plist
167
+
168
+ # 安卓默认打包release版本,可以改成debug版本
169
+ npx upload-build --ios-export-plist path/to/xxx.plist --variant=debug
167
170
```
168
171
169
172
Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ libs=$dir/libs
12
12
13
13
echo -e " \n\033[32mBuilding android app...\033[0m\n"
14
14
15
- pack_type=$( node $libs /pack-type.js " $@ " )
15
+ eval $( node $libs /pack-type.js " $@ " )
16
+ # pack_variant=
17
+ # pack_output_path=
16
18
17
- bash $libs /build-android.sh $pack_type
19
+ bash $libs /build-android.sh $pack_variant
18
20
19
- echo -e " \nView apk file at: \033[32m./android/app/build/outputs/apk/$pack_type \033[0m\n"
21
+ echo -e " \nView apk file at: \033[32m./android/app/build/outputs/apk/$pack_output_path \033[0m\n"
Original file line number Diff line number Diff line change @@ -23,13 +23,16 @@ ios_app_save_dir=./ios/build/app-$(date +%Y-%m-%d-%H-%M-%S)
23
23
24
24
echo -e " \n\033[32mBuilding android app...\033[0m\n"
25
25
26
- pack_type=$( node $libs /pack-type.js " $@ " )
27
- bash $libs /build-android.sh $pack_type
26
+ eval $( node $libs /pack-type.js " $@ " )
27
+ # pack_variant=
28
+ # pack_output_path=
29
+
30
+ bash $libs /build-android.sh $pack_variant
28
31
29
32
echo -e " \n\033[32mBuilding ios app...\033[0m\n"
30
33
31
34
bash $libs /archive.sh
32
35
bash $libs /export-ipa.sh $ios_export_plist $ios_app_save_dir
33
36
34
- echo -e " \nView apk file at: \033[32m./android/app/build/outputs/apk/release \033[0m"
37
+ echo -e " \nView apk file at: \033[32m./android/app/build/outputs/apk/$pack_output_path \033[0m"
35
38
echo -e " \nView ipa file at: \033[32m$ios_app_save_dir \033[0m\n"
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- pack_type =$1
5
+ pack_variant =$1
6
6
7
7
# Build for android
8
8
# The apk file will be at
9
9
# android/app/build/outputs/apk/app-release.apk
10
10
cd android
11
11
rm -rf build/ app/build/
12
12
13
- if [ $pack_type = " debug" ]
14
- then
15
- ./gradlew assembleDebug
16
- else
17
- ./gradlew assembleRelease
18
- fi
13
+ eval " ./gradlew assemble$pack_variant "
19
14
20
15
cd -
Original file line number Diff line number Diff line change @@ -2,10 +2,16 @@ const minimist = require('minimist');
2
2
3
3
const args = minimist ( process . argv . slice ( 2 ) ) ;
4
4
5
- let releaseType = 'release' ;
6
-
7
- if ( args . debug === true ) {
8
- releaseType = 'debug' ;
5
+ if ( ! args . variant || typeof args . variant !== 'string' ) {
6
+ args . variant = 'release' ;
9
7
}
10
8
11
- console . log ( releaseType ) ;
9
+ // path is case-insensitive on macos
10
+ const packVariant = args . variant . toLowerCase ( ) ;
11
+
12
+ console . log (
13
+ `
14
+ pack_variant=${ packVariant }
15
+ pack_output_path=${ packVariant . replace ( / ^ ( .* ) ( r e l e a s e | d e b u g ) $ / , '$1/$2' ) }
16
+ `
17
+ ) ;
Original file line number Diff line number Diff line change 25
25
echo -e " \033[32m[$log_prefix ] Building android app...\033[0m"
26
26
sleep 1
27
27
28
- pack_type=$( node $libs /pack-type.js " $@ " )
28
+ eval $( node $libs /pack-type.js " $@ " )
29
+ # pack_variant=
30
+ # pack_output_path=
29
31
30
- sh $libs /build-android.sh $pack_type
32
+ sh $libs /build-android.sh $pack_variant
31
33
32
- android_app=$( ls -l ./android/app/build/outputs/apk/$pack_type /* .apk | tail -n 1 | awk ' {print $NF}' )
34
+ android_app=$( ls -l ./android/app/build/outputs/apk/$pack_output_path /* .apk | tail -n 1 | awk ' {print $NF}' )
33
35
apk_info=$( node $libs /apk-info.js $android_app )
34
36
eval " $apk_info "
35
37
fi
Original file line number Diff line number Diff line change 33
33
echo -e " \033[32m[$log_prefix ] Building android app...\033[0m"
34
34
sleep 1
35
35
36
- pack_type=$( node $libs /pack-type.js " $@ " )
36
+ eval $( node $libs /pack-type.js " $@ " )
37
+ # pack_variant=
38
+ # pack_output_path=
37
39
38
- sh $libs /build-android.sh $pack_type
39
- android_app=$( ls -l ./android/app/build/outputs/apk/$pack_type /* .apk | tail -n 1 | awk ' {print $NF}' )
40
+ sh $libs /build-android.sh $pack_variant
41
+ android_app=$( ls -l ./android/app/build/outputs/apk/$pack_output_path /* .apk | tail -n 1 | awk ' {print $NF}' )
40
42
fi
41
43
42
44
if [ $ios -eq 0 ]
You can’t perform that action at this time.
0 commit comments