Skip to content

Commit 6c5488e

Browse files
author
minggo
authored
remove wp support (#417)
1 parent bf46283 commit 6c5488e

File tree

5 files changed

+6
-250
lines changed

5 files changed

+6
-250
lines changed

bin/cocos_project.py

Lines changed: 4 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ class Platforms(object):
196196
WEB = 'web'
197197
WIN32 = 'win32'
198198
LINUX = 'linux'
199-
WP8 = "wp8"
200-
WP8_1 = "wp8_1"
201199
METRO = "metro"
202200
TIZEN = "tizen"
203201

@@ -208,8 +206,6 @@ class Platforms(object):
208206
WEB : "cocos_project.WebConfig",
209207
WIN32 : "cocos_project.Win32Config",
210208
LINUX : "cocos_project.LinuxConfig",
211-
WP8 : "cocos_project.Wp8Config",
212-
WP8_1 : "cocos_project.Wp8_1Config",
213209
METRO : "cocos_project.MetroConfig",
214210
TIZEN : "cocos_project.TizenConfig"
215211
}
@@ -243,8 +239,8 @@ def _filter_platforms(self, platforms):
243239
platforms_for_os = {
244240
"linux" : [ Platforms.WEB, Platforms.LINUX, Platforms.ANDROID, Platforms.TIZEN ],
245241
"mac" : [ Platforms.WEB, Platforms.IOS, Platforms.MAC, Platforms.ANDROID, Platforms.TIZEN ],
246-
"win32" : [ Platforms.WEB, Platforms.WIN32, Platforms.ANDROID, Platforms.WP8,
247-
Platforms.WP8_1, Platforms.METRO, Platforms.TIZEN ]
242+
"win32" : [ Platforms.WEB, Platforms.WIN32, Platforms.ANDROID,
243+
Platforms.METRO, Platforms.TIZEN ]
248244
}
249245
for p in platforms:
250246
if cocos.os_is_linux():
@@ -271,14 +267,14 @@ def _gen_available_platforms(self, proj_info, proj_dir):
271267
platform_list = []
272268
elif self._project._is_js_project():
273269
if self._project._is_native_support():
274-
platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.WEB, Platforms.LINUX, Platforms.WP8, Platforms.WP8_1, Platforms.METRO, Platforms.TIZEN ]
270+
platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.WEB, Platforms.LINUX, Platforms.METRO, Platforms.TIZEN ]
275271
else:
276272
if self._project.has_android_libs():
277273
platform_list = [ Platforms.ANDROID, Platforms.WEB ]
278274
else:
279275
platform_list = [ Platforms.WEB ]
280276
elif self._project._is_cpp_project():
281-
platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.WP8, Platforms.WP8_1, Platforms.METRO, Platforms.TIZEN ]
277+
platform_list = [ Platforms.ANDROID, Platforms.WIN32, Platforms.IOS, Platforms.MAC, Platforms.LINUX, Platforms.METRO, Platforms.TIZEN ]
282278

283279
# filter the available platform list
284280
platform_list = self._filter_platforms(platform_list)
@@ -335,12 +331,6 @@ def is_win32_active(self):
335331
def is_linux_active(self):
336332
return self._current == Platforms.LINUX
337333

338-
def is_wp8_active(self):
339-
return self._current == Platforms.WP8
340-
341-
def is_wp8_1_active(self):
342-
return self._current == Platforms.WP8_1
343-
344334
def is_metro_active(self):
345335
return self._current == Platforms.METRO
346336

@@ -609,82 +599,6 @@ def _is_available(self):
609599

610600
return ret
611601

612-
class Wp8Config(PlatformConfig):
613-
KEY_BUILD_FOLDER_PATH = "build_folder_path"
614-
KEY_MANIFEST_PATH = "manifest_path"
615-
KEY_WP8_PROJ_PATH = 'wp8_proj_path'
616-
617-
def _use_default(self):
618-
if self._is_script:
619-
self.proj_path = os.path.join(self._proj_root_path, "frameworks", "runtime-src", "proj.wp8-xaml")
620-
else:
621-
self.proj_path = os.path.join(self._proj_root_path, "proj.wp8-xaml")
622-
623-
self.wp8_proj_path = self.proj_path
624-
self.sln_file = None
625-
self.project_name =None
626-
self.build_folder_path = "App/Bin/x86"
627-
self.manifest_path = "App/Properties/WMAppManifest.xml"
628-
629-
def _parse_info(self, cfg_info):
630-
super(Wp8Config, self)._parse_info(cfg_info)
631-
if cfg_info.has_key(Win32Config.KEY_SLN_FILE):
632-
self.sln_file = cfg_info[Win32Config.KEY_SLN_FILE]
633-
else:
634-
self.sln_file = None
635-
636-
if cfg_info.has_key(Wp8Config.KEY_WP8_PROJ_PATH):
637-
self.wp8_proj_path = os.path.join(self._proj_root_path, cfg_info[Wp8Config.KEY_WP8_PROJ_PATH])
638-
else:
639-
self.wp8_proj_path = self.proj_path
640-
641-
if cfg_info.has_key(Win32Config.KEY_PROJECT_NAME):
642-
self.project_name = cfg_info[Win32Config.KEY_PROJECT_NAME]
643-
else:
644-
self.project_name = None
645-
646-
if cfg_info.has_key(Wp8Config.KEY_BUILD_FOLDER_PATH):
647-
self.build_folder_path = cfg_info[Wp8Config.KEY_BUILD_FOLDER_PATH]
648-
else:
649-
self.build_folder_path = "App/Bin/x86"
650-
651-
if cfg_info.has_key(Wp8Config.KEY_MANIFEST_PATH):
652-
self.manifest_path = cfg_info[Wp8Config.KEY_MANIFEST_PATH]
653-
else:
654-
self.manifest_path = "App/Properties/WMAppManifest.xml"
655-
656-
def _is_available(self):
657-
ret = super(Wp8Config, self)._is_available()
658-
659-
return ret
660-
661-
class Wp8_1Config(PlatformConfig):
662-
def _use_default(self):
663-
if self._is_script:
664-
self.proj_path = os.path.join(self._proj_root_path, "frameworks", "runtime-src", "proj.win8.1-universal")
665-
else:
666-
self.proj_path = os.path.join(self._proj_root_path, "proj.win8.1-universal")
667-
668-
self.sln_file = None
669-
self.project_name =None
670-
671-
def _parse_info(self, cfg_info):
672-
super(Wp8_1Config, self)._parse_info(cfg_info)
673-
if cfg_info.has_key(Win32Config.KEY_SLN_FILE):
674-
self.sln_file = cfg_info[Win32Config.KEY_SLN_FILE]
675-
else:
676-
self.sln_file = None
677-
678-
if cfg_info.has_key(Win32Config.KEY_PROJECT_NAME):
679-
self.project_name = cfg_info[Win32Config.KEY_PROJECT_NAME]
680-
else:
681-
self.project_name = None
682-
683-
def _is_available(self):
684-
ret = super(Wp8_1Config, self)._is_available()
685-
686-
return ret
687-
688602
class MetroConfig(PlatformConfig):
689603
def _use_default(self):
690604
if self._is_script:

plugins/plugin_compile/project_compile.py

Lines changed: 2 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,8 @@ def get_required_vs_versions(self):
10091009
return ret
10101010

10111011
def get_min_vs_version(self):
1012-
if self._platforms.is_wp8_active() or self._platforms.is_wp8_1_active() or self._platforms.is_metro_active():
1013-
# WP8 project required VS 2013
1012+
if self._platforms.is_metro_active():
1013+
# metro project required VS 2013
10141014
return 2013
10151015
else:
10161016
# win32 project required VS 2012
@@ -1434,120 +1434,6 @@ def build_linux(self):
14341434

14351435
cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_BUILD_SUCCEED'))
14361436

1437-
def get_wp8_product_id(self, manifest_file):
1438-
# get the product id from manifest
1439-
from xml.dom import minidom
1440-
1441-
ret = None
1442-
try:
1443-
doc_node = minidom.parse(manifest_file)
1444-
root_node = doc_node.documentElement
1445-
app_node = root_node.getElementsByTagName("App")[0]
1446-
ret = app_node.attributes["ProductID"].value
1447-
ret = ret.strip("{}")
1448-
except:
1449-
raise cocos.CCPluginError(MultiLanguage.get_string('COMPILE_ERROR_MANIFEST_PARSE_FAILED_FMT', manifest_file),
1450-
cocos.CCPluginError.ERROR_PARSE_FILE)
1451-
1452-
return ret
1453-
1454-
1455-
def build_wp8(self):
1456-
if not self._platforms.is_wp8_active():
1457-
return
1458-
1459-
proj_path = self._project.get_project_dir()
1460-
sln_path = self._platforms.project_path()
1461-
output_dir = self._output_dir
1462-
1463-
cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_BUILDING'))
1464-
1465-
# get the solution file & project name
1466-
cfg_obj = self._platforms.get_current_config()
1467-
if cfg_obj.sln_file is not None:
1468-
sln_name = cfg_obj.sln_file
1469-
if cfg_obj.project_name is None:
1470-
raise cocos.CCPluginError(MultiLanguage.get_string('COMPILE_ERROR_CFG_NOT_FOUND_FMT',
1471-
(cocos_project.Win32Config.KEY_PROJECT_NAME,
1472-
cocos_project.Win32Config.KEY_SLN_FILE,
1473-
cocos_project.Project.CONFIG)),
1474-
cocos.CCPluginError.ERROR_WRONG_CONFIG)
1475-
else:
1476-
name = cfg_obj.project_name
1477-
else:
1478-
name, sln_name = self.checkFileByExtention(".sln", sln_path)
1479-
if not sln_name:
1480-
message = MultiLanguage.get_string('COMPILE_ERROR_SLN_NOT_FOUND')
1481-
raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_PATH_NOT_FOUND)
1482-
1483-
wp8_projectdir = cfg_obj.wp8_proj_path
1484-
1485-
# build the project
1486-
self.project_name = name
1487-
projectPath = os.path.join(sln_path, sln_name)
1488-
build_mode = 'Debug' if self._is_debug_mode() else 'Release'
1489-
self.build_vs_project(projectPath, self.project_name, build_mode, self.vs_version)
1490-
1491-
# copy files
1492-
build_folder_path = os.path.join(wp8_projectdir, cfg_obj.build_folder_path, build_mode)
1493-
if not os.path.isdir(build_folder_path):
1494-
message = MultiLanguage.get_string('COMPILE_ERROR_BUILD_PATH_NOT_FOUND_FMT', build_folder_path)
1495-
raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_PATH_NOT_FOUND)
1496-
1497-
# create output dir if it not existed
1498-
if not os.path.exists(output_dir):
1499-
os.makedirs(output_dir)
1500-
1501-
# copy xap
1502-
files = os.listdir(build_folder_path)
1503-
proj_xap_name = "%s_%s_x86.xap" % (self.project_name, build_mode)
1504-
for filename in files:
1505-
if filename == proj_xap_name:
1506-
file_path = os.path.join(build_folder_path, filename)
1507-
cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_COPYING_FMT', filename))
1508-
shutil.copy(file_path, output_dir)
1509-
break
1510-
1511-
# get the manifest file path
1512-
manifest_file = os.path.join(wp8_projectdir, cfg_obj.manifest_path)
1513-
self.product_id = self.get_wp8_product_id(manifest_file)
1514-
self.run_root = output_dir
1515-
self.xap_file_name = proj_xap_name
1516-
1517-
def build_wp8_1(self):
1518-
if not self._platforms.is_wp8_1_active():
1519-
return
1520-
1521-
wp8_1_projectdir = self._platforms.project_path()
1522-
output_dir = self._output_dir
1523-
1524-
cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_BUILDING'))
1525-
1526-
# get the solution file & project name
1527-
cfg_obj = self._platforms.get_current_config()
1528-
if cfg_obj.sln_file is not None:
1529-
sln_name = cfg_obj.sln_file
1530-
if cfg_obj.project_name is None:
1531-
raise cocos.CCPluginError(MultiLanguage.get_string('COMPILE_ERROR_CFG_NOT_FOUND_FMT',
1532-
(cocos_project.Win32Config.KEY_PROJECT_NAME,
1533-
cocos_project.Win32Config.KEY_SLN_FILE,
1534-
cocos_project.Project.CONFIG)),
1535-
cocos.CCPluginError.ERROR_WRONG_CONFIG)
1536-
else:
1537-
name = cfg_obj.project_name
1538-
else:
1539-
name, sln_name = self.checkFileByExtention(".sln", wp8_1_projectdir)
1540-
if not sln_name:
1541-
message = MultiLanguage.get_string('COMPILE_ERROR_SLN_NOT_FOUND')
1542-
raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_PATH_NOT_FOUND)
1543-
name = "%s.WindowsPhone" % name
1544-
1545-
# build the project
1546-
self.project_name = name
1547-
projectPath = os.path.join(wp8_1_projectdir, sln_name)
1548-
build_mode = 'Debug' if self._is_debug_mode() else 'Release'
1549-
self.build_vs_project(projectPath, self.project_name, build_mode, self.vs_version)
1550-
15511437
def build_metro(self):
15521438
if not self._platforms.is_metro_active():
15531439
return
@@ -1719,8 +1605,6 @@ def run(self, argv, dependencies):
17191605
self.build_win32()
17201606
self.build_web()
17211607
self.build_linux()
1722-
self.build_wp8()
1723-
self.build_wp8_1()
17241608
self.build_metro()
17251609
self.build_tizen()
17261610

plugins/plugin_deploy.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,30 +139,6 @@ def find_xap_deploy_tool(self):
139139

140140
return find_ret
141141

142-
def deploy_wp8(self, dependencies):
143-
if not self._platforms.is_wp8_active():
144-
return
145-
146-
compile_dep = dependencies['compile']
147-
run_root = compile_dep.run_root
148-
product_id = compile_dep.product_id
149-
xap_file_name = compile_dep.xap_file_name
150-
self.xap_path = os.path.join(run_root, xap_file_name)
151-
152-
# find the XapDeployCmd.exe
153-
self.deploy_tool = self.find_xap_deploy_tool()
154-
if self.deploy_tool is None:
155-
raise cocos.CCPluginError(MultiLanguage.get_string('DEPLOY_ERROR_XAPCMD_NOT_FOUND'),
156-
cocos.CCPluginError.ERROR_TOOLS_NOT_FOUND)
157-
158-
if not self._no_uninstall:
159-
# uninstall the app on wp8 by product ID
160-
try:
161-
uninstall_cmd = '"%s" /uninstall %s /targetdevice:xd' % (self.deploy_tool, product_id)
162-
self._run_cmd(uninstall_cmd)
163-
except:
164-
pass
165-
166142
def deploy_linux(self, dependencies):
167143
if not self._platforms.is_linux_active():
168144
return
@@ -237,5 +213,4 @@ def run(self, argv, dependencies):
237213
self.deploy_web(dependencies)
238214
self.deploy_win32(dependencies)
239215
self.deploy_linux(dependencies)
240-
self.deploy_wp8(dependencies)
241216
self.deploy_tizen(dependencies)

plugins/plugin_generate/configs/gen_templates_config.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"exclude": [
77
"*android-studio",
88
"*win10",
9-
"*wp8",
10-
"*win8.1-universal",
119
"*linux",
1210
"*CMakeLists.txt",
1311
"Resources",
@@ -29,8 +27,6 @@
2927
"exclude": [
3028
"*android-studio",
3129
"*win10",
32-
"*wp8",
33-
"*win8.1-universal",
3430
"*linux",
3531
"*CMakeLists.txt"
3632
]
@@ -48,8 +44,6 @@
4844
"exclude": [
4945
"*android-studio",
5046
"*win10",
51-
"*wp8",
52-
"*win8.1-universal",
5347
"*linux",
5448
"*CMakeLists.txt",
5549
"res/*",

plugins/plugin_run/project_run.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,6 @@ def run_win32(self, dependencies):
304304
with cocos.pushd(run_root):
305305
self._run_with_desktop_options(os.path.join(run_root, exe))
306306

307-
def run_wp8(self, dependencies):
308-
if not self._platforms.is_wp8_active():
309-
return
310-
311-
deploy_dep = dependencies['deploy']
312-
xap_path = deploy_dep.xap_path
313-
deploy_tool = deploy_dep.deploy_tool
314-
cmd = '"%s" /installlaunch "%s" /targetDevice:xd' % (deploy_tool, xap_path)
315-
self._run_cmd(cmd)
316-
317307
def run_linux(self, dependencies):
318308
if not self._platforms.is_linux_active():
319309
return
@@ -346,6 +336,5 @@ def run(self, argv, dependencies):
346336
self.run_web(dependencies)
347337
self.run_win32(dependencies)
348338
self.run_linux(dependencies)
349-
self.run_wp8(dependencies)
350339
self.run_tizen(dependencies)
351340

0 commit comments

Comments
 (0)