Skip to content

Commit 6e9875a

Browse files
committed
1 parent 69506eb commit 6e9875a

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

data/Info.plist

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>${PRODUCT_NAME}</string>
9+
<key>CFBundleExecutable</key>
10+
<string>${EXECUTABLE_NAME}</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>${PRODUCT_NAME}</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIRequiresFullScreen</key>
28+
<true/>
29+
<key>UIRequiredDeviceCapabilities</key>
30+
<array>
31+
<string>armv7</string>
32+
</array>
33+
<key>UISupportedInterfaceOrientations</key>
34+
<array>
35+
<string>UIInterfaceOrientationPortrait</string>
36+
<string>UIInterfaceOrientationLandscapeLeft</string>
37+
<string>UIInterfaceOrientationLandscapeRight</string>
38+
</array>
39+
<key>UISupportedInterfaceOrientations~ipad</key>
40+
<array>
41+
<string>UIInterfaceOrientationPortrait</string>
42+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
43+
<string>UIInterfaceOrientationLandscapeLeft</string>
44+
<string>UIInterfaceOrientationLandscapeRight</string>
45+
</array>
46+
<key>CFBundleURLTypes</key>
47+
<array>
48+
<dict>
49+
<key>CFBundleURLSchemes</key>
50+
<array>
51+
<string>fbXXXXXXXXX</string>
52+
</array>
53+
</dict>
54+
</array>
55+
</dict>
56+
</plist>

tests/build/ios/prepare_ios_tests.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from core.osutils.command import run
1010
from core.osutils.file import File
1111
from core.osutils.folder import Folder
12-
from core.settings.settings import IOS_RUNTIME_PATH, CURRENT_OS, OSType
12+
from core.settings.settings import IOS_RUNTIME_PATH, CURRENT_OS, OSType, TEST_RUN_HOME
1313
from core.tns.replace_helper import ReplaceHelper
1414
from core.tns.tns import Tns
1515
from core.tns.tns_platform_type import Platform
@@ -79,6 +79,27 @@ def test_201_prepare_ios_platform_not_added(self):
7979
output = Tns.prepare_ios(attributes={"--path": self.app_name})
8080
TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.FIRST_TIME)
8181

82+
def test_220_build_ios_with_custom_plist(self):
83+
Tns.create_app(self.app_name)
84+
Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})
85+
86+
# Update Info.plist
87+
src_file = os.path.join(TEST_RUN_HOME, 'data', 'Info.plist')
88+
target_file = os.path.join(TEST_RUN_HOME, self.app_name, 'app', 'App_Resources', 'iOS', 'Info.plist')
89+
File.remove(target_file)
90+
File.copy(src=src_file, dest=target_file)
91+
92+
# Prepare in debug
93+
final_plist = os.path.join(TEST_RUN_HOME, self.app_name, 'platforms', 'ios', 'TestApp', 'TestApp-Info.plist')
94+
Tns.prepare_ios(attributes={"--path": self.app_name})
95+
assert "<string>fbXXXXXXXXX</string>" in File.read(final_plist)
96+
assert "<string>orgnativescriptTestApp</string>" in File.read(final_plist)
97+
98+
# Prepare in release
99+
Tns.prepare_ios(attributes={"--path": self.app_name, '--release': ''})
100+
assert "<string>fbXXXXXXXXX</string>" in File.read(final_plist)
101+
assert not "<string>orgnativescriptTestApp</string>" in File.read(final_plist)
102+
82103
def test_300_prepare_ios_preserve_case(self):
83104
Tns.create_app(self.app_name)
84105
Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})

0 commit comments

Comments
 (0)