FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nativescript-dev-webpack/androidProjectHelpers.js at 1.2.1 · NativeScript/nativescript-dev-webpack · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
NativeScript
/
nativescript-dev-webpack
Public archive
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
40
Star
97
Code
Issues
82
Pull requests
3
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
nativescript-dev-webpack
/
androidProjectHelpers.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
66 lines (57 loc) · 1.89 KB
Breadcrumbs
nativescript-dev-webpack
/
androidProjectHelpers.js
Copy path
File metadata and controls
66 lines (57 loc) · 1.89 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const
{
join
,
resolve
}
=
require
(
"path"
)
;
const
{
existsSync
,
readFileSync
}
=
require
(
"fs"
)
;
const
{
getPackageJson
}
=
require
(
"./projectHelpers"
)
;
const
PLATFORMS_ANDROID
=
"platforms/android"
;
const
ANDROID_PROJECT_DIR
=
join
(
PLATFORMS_ANDROID
,
"app"
)
;
const
ANDROID_APP_PATH
=
join
(
ANDROID_PROJECT_DIR
,
"src/main/assets/app"
)
;
const
ANDROID_CONFIGURATIONS_PATH
=
join
(
ANDROID_PROJECT_DIR
,
"build/configurations"
)
;
const
getAndroidRuntimeVersion
=
(
projectDir
)
=>
{
try
{
const
projectPackageJSON
=
getPackageJson
(
projectDir
)
;
const
version
=
projectPackageJSON
[
"nativescript"
]
[
"tns-android"
]
[
"version"
]
;
return
version
&&
toReleaseVersion
(
version
)
;
}
catch
(
e
)
{
return
null
;
}
}
const
toReleaseVersion
=
version
=>
version
.
replace
(
/
-
.
*
/
,
""
)
;
const
getAndroidV8Version
=
(
projectDir
)
=>
{
try
{
const
androidSettingsJSON
=
getAndroidSettingsJson
(
projectDir
)
;
if
(
androidSettingsJSON
!==
null
)
{
return
androidSettingsJSON
.
v8Version
;
}
else
{
return
null
;
}
}
catch
(
e
)
{
return
null
;
}
}
const
getMksnapshotParams
=
(
projectDir
)
=>
{
try
{
const
androidSettingsJSON
=
getAndroidSettingsJson
(
projectDir
)
;
if
(
androidSettingsJSON
!==
null
)
{
return
androidSettingsJSON
.
mksnapshotParams
;
}
else
{
return
null
;
}
}
catch
(
e
)
{
return
null
;
}
}
;
const
getAndroidSettingsJson
=
projectDir
=>
{
const
androidSettingsJsonPath
=
resolve
(
projectDir
,
PLATFORMS_ANDROID
,
"settings.json"
)
;
if
(
existsSync
(
androidSettingsJsonPath
)
)
{
return
JSON
.
parse
(
readFileSync
(
androidSettingsJsonPath
,
"utf8"
)
)
;
}
else
{
return
null
;
}
}
;
module
.
exports
=
{
ANDROID_PROJECT_DIR
,
ANDROID_APP_PATH
,
ANDROID_CONFIGURATIONS_PATH
,
getAndroidRuntimeVersion
,
getAndroidV8Version
,
getMksnapshotParams
}
;
Back
|
FazBrowse Home
|
New Git URL