Skip to content

Commit

Permalink
chore: 修改逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
shinken008 committed Jun 15, 2021
1 parent b628dae commit c701237
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 11 deletions.
27 changes: 22 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

40 changes: 35 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,49 @@ async function run(): Promise<void> {

await execDebug(`mv ${ANDROID_BUNDLE} ${androidShellBundle}`)
await execDebug(`rsync -a ${ANDROID_ASSETS} ${androidShellAssets}`)
await execDebug(`rsync -a ${ANDROID_ASSETS}/res ${androidShellAssets}`)
} else if (platform === 'ios') {
await execDebug(`${buildCMD} --platform ios`)
// 6. 移动 bundle 文件到壳子制定目录 mv dist/rn/android/index.android.bundle taro-native-shell/android/app/src/main/assets/index.android.bundle
const androidShellBundle = path.join(
const iosShellBundle = path.join(
repoSettings.repositoryPath,
'ios/main.jsbundle'
)
const androidShellAssets = path.join(repoSettings.repositoryPath, 'ios')
const iosShellAssets = path.join(repoSettings.repositoryPath, 'ios')

await execDebug(`mv ${IOS_BUNDLE} ${androidShellBundle}`)
await execDebug(`rsync -a ${IOS_ASSETS} ${androidShellAssets}`)
await execDebug(`mv ${IOS_BUNDLE} ${iosShellBundle}`)
await execDebug(`rsync -a ${IOS_ASSETS} ${iosShellAssets}`)
} else {
core.setFailed('Please set env.PLATFORM')
// 不指定平台则打包所有
await execDebug(buildCMD)
// 6. 移动 bundle 文件到壳子制定目录 mv dist/rn/android/index.android.bundle taro-native-shell/android/app/src/main/assets/index.android.bundle
const androidShellBundle = path.join(
repoSettings.repositoryPath,
'android/app/src/main/assets/index.android.bundle'
)
const androidShellAssets = path.join(
repoSettings.repositoryPath,
'android/app/src/main/res'
)

if (APP_ICON === 'ic_launcher') {
// await execDebug(
// `rm ./taro-native-shell/android/app/src/main/res/mipmap-*dpi/ic_launcher.png`
// )
}

await execDebug(`mv ${ANDROID_BUNDLE} ${androidShellBundle}`)
await execDebug(`rsync -a ${ANDROID_ASSETS} ${androidShellAssets}`)
await execDebug(`rsync -a ${ANDROID_ASSETS}/res ${androidShellAssets}`)

const iosShellBundle = path.join(
repoSettings.repositoryPath,
'ios/main.jsbundle'
)
const iosShellAssets = path.join(repoSettings.repositoryPath, 'ios')

await execDebug(`mv ${IOS_BUNDLE} ${iosShellBundle}`)
await execDebug(`rsync -a ${IOS_ASSETS} ${iosShellAssets}`)
}

// // 6. 移动 bundle 文件到壳子制定目录 mv dist/rn/android/index.android.bundle taro-native-shell/android/app/src/main/assets/index.android.bundle
Expand Down

0 comments on commit c701237

Please sign in to comment.