Skip to content

Commit d77fb72

Browse files
author
Dimitar Topuzov
committed
Use NEXT_TAG insted of "next" string
1 parent 3ec49b9 commit d77fb72

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

core/tns/tns.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818

1919
class Tns(object):
20+
# npm tag used when we publish master branch of https://github.com/NativeScript/NativeScript
21+
# Please see https://github.com/NativeScript/NativeScript/blob/master/.travis.yml
22+
NEXT_TAG = 'internal-preview'
23+
2024
@staticmethod
2125
def __get_platform_string(platform=Platforms.NONE):
2226
if platform is Platforms.NONE:
@@ -107,7 +111,7 @@ def update_modules(path, tns_path=None):
107111
# In master branch we use @next packages.
108112
else:
109113
Tns.plugin_remove("tns-core-modules", attributes={"--path": path}, assert_success=False, tns_path=tns_path)
110-
output = Tns.plugin_add("tns-core-modules@next", attributes={"--path": path}, tns_path=tns_path)
114+
output = Tns.plugin_add("tns-core-modules@" + Tns.NEXT_TAG, attributes={"--path": path}, tns_path=tns_path)
111115
assert "undefined" not in output, "Something went wrong when modules are installed."
112116
assert "ERR" not in output, "Something went wrong when modules are installed."
113117
return output
@@ -259,15 +263,15 @@ def plugin_add(name, attributes={}, log_trace=False, assert_success=True, tns_pa
259263
output = Tns.run_tns_command("plugin add " + name, attributes=attributes, log_trace=log_trace,
260264
tns_path=tns_path)
261265
if assert_success:
262-
assert "Successfully installed plugin {0}".format(name.replace("@next", "")) in output
266+
assert "Successfully installed plugin {0}".format(name.replace("@" + Tns.NEXT_TAG, "")) in output
263267
return output
264268

265269
@staticmethod
266270
def plugin_remove(name, attributes={}, log_trace=False, assert_success=True, tns_path=None):
267271
output = Tns.run_tns_command("plugin remove " + name, attributes=attributes, log_trace=log_trace,
268272
tns_path=tns_path)
269273
if assert_success:
270-
assert "Successfully removed plugin {0}".format(name.replace("@next", "")) in output
274+
assert "Successfully removed plugin {0}".format(name.replace("@" + Tns.NEXT_TAG, "")) in output
271275
return output
272276

273277
@staticmethod

tests/build/PlatformAndroid_Tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def test_130_platform_remove_and_platform_add_android_custom_version(self):
4848
Tns.platform_remove(platform=Platforms.ANDROID, attributes={"--path": self.app_name})
4949

5050
# Add custom version with tag
51-
Tns.platform_add_android(version="next", attributes={"--path": self.app_name})
52-
TnsAsserts.package_json_contains(self.app_name, ["next"])
51+
Tns.platform_add_android(version=Tns.NEXT_TAG, attributes={"--path": self.app_name})
52+
TnsAsserts.package_json_contains(self.app_name, [Tns.NEXT_TAG])
5353
# tns-android@next package include 'next' as string in version
5454

5555
def test_200_platform_update_android(self):

0 commit comments

Comments
 (0)