Skip to content

Commit

Permalink
perf: ♻️ 补充依赖及目录结构调整
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 30, 2023
1 parent 93ad836 commit b18256b
Show file tree
Hide file tree
Showing 59 changed files with 60,841 additions and 19 deletions.
7 changes: 4 additions & 3 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"artifactName": "${productName}-${version}-win-${arch}.${ext}",
"extraResources": {
"from": "electron/resources/extra",
"to": "extra"
"to": "extra",
"filter": ["common", "win"]
}
},
"nsis": {
Expand Down Expand Up @@ -58,7 +59,7 @@
"extraResources": {
"from": "electron/resources/extra",
"to": "extra",
"filter": ["**/*", "!core", "!adb"]
"filter": ["common", "mac"]
},
"entitlementsInherit": "entitlements.mac.plist",
"extendInfo": {
Expand Down Expand Up @@ -89,7 +90,7 @@
"extraResources": {
"from": "electron/resources/extra",
"to": "extra",
"filter": ["**/*", "!core", "!adb"]
"filter": ["common", "linux"]
}
},
"asar": true,
Expand Down
14 changes: 14 additions & 0 deletions electron/configs/adb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { extraResolve } from '@electron/helpers/index.js'

export const getAdbPath = () => {
switch (process.platform) {
case 'win32':
return extraResolve('win/platform-tools/adb.exe')
case 'darwin':
return extraResolve('mac/platform-tools/adb')
case 'linux':
return extraResolve('linux/platform-tools/adb')
}
}

export const adbPath = getAdbPath()
22 changes: 6 additions & 16 deletions electron/configs/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { resolve } from 'node:path'
import which from 'which'

import { buildResolve, extraResolve } from '@electron/helpers/index.js'

export { adbPath } from './adb.js'

export { scrcpyPath } from './scrcpy.js'

export const desktopPath = process.env.DESKTOP_PATH

export const devPublishPath = resolve('dev-publish.yml')
Expand All @@ -13,20 +16,7 @@ export const icnsLogoPath = buildResolve('logo.icns')

export const trayPath
= process.platform === 'darwin'
? extraResolve('trayTemplate.png')
: extraResolve('tray.png')

export const adbPath
= process.platform === 'win32'
? extraResolve('adb/adb.exe')
: which.sync('adb', { nothrow: true })

export const scrcpyPath
= process.platform === 'win32'
? extraResolve('core/scrcpy.exe')
: which.sync('scrcpy', { nothrow: true })
? extraResolve('mac/tray/iconTemplate.png')
: extraResolve('common/tray/icon.png')

export const logPath = process.env.LOG_PATH

// console.log('adbPath', adbPath)
// console.log('scrcpyPath', scrcpyPath)
17 changes: 17 additions & 0 deletions electron/configs/scrcpy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { extraResolve } from '@electron/helpers/index.js'
import which from 'which'

export const getScrcpyPath = () => {
switch (process.platform) {
case 'win32':
return extraResolve('win/scrcpy/scrcpy.exe')
// case 'darwin':
// return extraResolve('mac/scrcpy/scrcpy')
// case 'linux':
// return extraResolve('linux/scrcpy/scrcpy')
default:
return which.sync('scrcpy', { nothrow: true })
}
}

export const scrcpyPath = getScrcpyPath()
File renamed without changes
20,192 changes: 20,192 additions & 0 deletions electron/resources/extra/linux/platform-tools/NOTICE.txt

Large diffs are not rendered by default.

Binary file added electron/resources/extra/linux/platform-tools/adb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
53 changes: 53 additions & 0 deletions electron/resources/extra/linux/platform-tools/mke2fs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[defaults]
base_features = sparse_super,large_file,filetype,dir_index,ext_attr
default_mntopts = acl,user_xattr
enable_periodic_fsck = 0
blocksize = 4096
inode_size = 256
inode_ratio = 16384
reserved_ratio = 1.0

[fs_types]
ext3 = {
features = has_journal
}
ext4 = {
features = has_journal,extent,huge_file,dir_nlink,extra_isize,uninit_bg
inode_size = 256
}
ext4dev = {
features = has_journal,extent,huge_file,flex_bg,inline_data,64bit,dir_nlink,extra_isize
inode_size = 256
options = test_fs=1
}
small = {
blocksize = 1024
inode_size = 128
inode_ratio = 4096
}
floppy = {
blocksize = 1024
inode_size = 128
inode_ratio = 8192
}
big = {
inode_ratio = 32768
}
huge = {
inode_ratio = 65536
}
news = {
inode_ratio = 4096
}
largefile = {
inode_ratio = 1048576
blocksize = -1
}
largefile4 = {
inode_ratio = 4194304
blocksize = -1
}
hurd = {
blocksize = 4096
inode_size = 128
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Pkg.UserSrc=false
Pkg.Revision=34.0.5
Binary file not shown.
Loading

0 comments on commit b18256b

Please sign in to comment.