@@ -115,14 +115,6 @@ def _add_custom_options(self, parser):
115
115
group .add_argument ("--lua-encrypt-sign" , dest = "lua_encrypt_sign" ,
116
116
help = MultiLanguage .get_string ('COMPILE_ARG_LUA_ENCRYPT_SIGN' ))
117
117
118
- group = parser .add_argument_group (MultiLanguage .get_string ('COMPILE_ARG_GROUP_TIZEN' ))
119
- group .add_argument ("--tizen-arch" , dest = "tizen_arch" , default = "x86" , choices = [ "x86" , "arm" ], help = MultiLanguage .get_string ('COMPILE_ARG_TIZEN_ARCH' ))
120
- # group.add_argument("--tizen-compiler", dest="tizen_compiler", choices=[ "llvm", "gcc" ], help=MultiLanguage.get_string('COMPILE_ARG_TIZEN_COMPILER'))
121
- # group.add_argument("--tizen-pkgtype", dest="tizen_pkgtype", default="tpk", choices=[ "tpk", "wgt" ], help=MultiLanguage.get_string('COMPILE_ARG_TIZEN_PKGTYPE'))
122
- group .add_argument ("--tizen-profile" , dest = "tizen_profile" , help = MultiLanguage .get_string ('COMPILE_ARG_TIZEN_PROFILE' ))
123
- group .add_argument ("--tizen-sign" , dest = "tizen_sign" , help = MultiLanguage .get_string ('COMPILE_ARG_TIZEN_SIGN' ))
124
- group .add_argument ("--tizen-strip" , dest = "tizen_strip" , action = "store_true" , help = MultiLanguage .get_string ('COMPILE_ARG_TIZEN_STRIP' ))
125
-
126
118
category = self .plugin_category ()
127
119
name = self .plugin_name ()
128
120
usage = "\n \t %%prog %s %s -p <platform> [-s src_dir][-m <debug|release>]" \
@@ -165,15 +157,6 @@ def _check_custom_options(self, args):
165
157
if args .target_name is not None :
166
158
self .xcode_target_name = args .target_name
167
159
168
- # Tizen arguments
169
- self .tizen_arch = args .tizen_arch
170
- # self.tizen_compiler = args.tizen_compiler
171
- # self.tizen_pkgtype = args.tizen_pkgtype
172
- self .tizen_pkgtype = 'tpk'
173
- self .tizen_sign = args .tizen_sign
174
- self .tizen_strip = args .tizen_strip
175
- self .tizen_profile = args .tizen_profile
176
-
177
160
if args .compile_script is not None :
178
161
self ._compile_script = bool (args .compile_script )
179
162
else :
@@ -1492,90 +1475,6 @@ def build_metro(self):
1492
1475
build_mode = 'Debug' if self ._is_debug_mode () else 'Release'
1493
1476
self .build_vs_project (projectPath , self .project_name , build_mode , self .vs_version )
1494
1477
1495
- def _build_tizen_proj (self , tizen_cmd_path , build_mode , proj_path ):
1496
- build_native_cmd = "%s build-native -- \" %s\" " % (tizen_cmd_path , proj_path )
1497
- build_native_cmd += " -C %s" % build_mode
1498
- build_native_cmd += " -a %s" % self .tizen_arch
1499
-
1500
- # if self.tizen_compiler is not None:
1501
- # build_native_cmd += " -c %s" % self.tizen_compiler
1502
- # TODO now only support gcc
1503
- build_native_cmd += " -c gcc"
1504
-
1505
- self ._run_cmd (build_native_cmd )
1506
-
1507
- def build_tizen (self ):
1508
- if not self ._platforms .is_tizen_active ():
1509
- return
1510
-
1511
- tizen_studio_path = cocos .check_environment_variable ("TIZEN_STUDIO_HOME" )
1512
- tizen_proj_path = self ._platforms .project_path ()
1513
- tizen_cmd_path = cocos .CMDRunner .convert_path_to_cmd (os .path .join (tizen_studio_path , "tools" , "ide" , "bin" , "tizen" ))
1514
- build_mode = 'Debug' if self ._is_debug_mode () else 'Release'
1515
-
1516
- # build library projects
1517
- build_cfg_data = self ._get_build_cfg ()
1518
- if build_cfg_data .has_key ('depend_projs' ):
1519
- lib_projs = build_cfg_data ['depend_projs' ]
1520
- for proj in lib_projs :
1521
- proj_path = os .path .normpath (os .path .join (self ._build_cfg_path (), proj ))
1522
- self ._build_tizen_proj (tizen_cmd_path , build_mode , proj_path )
1523
-
1524
- # build the game project
1525
- self ._build_tizen_proj (tizen_cmd_path , build_mode , tizen_proj_path )
1526
-
1527
- # copy resources files
1528
- res_path = os .path .join (tizen_proj_path , 'res' )
1529
- self ._copy_resources (res_path )
1530
-
1531
- # check the project config & compile the script files
1532
- if self ._project ._is_js_project ():
1533
- self .compile_js_scripts (res_path , res_path )
1534
-
1535
- if self ._project ._is_lua_project ():
1536
- self .compile_lua_scripts (res_path , res_path , False )
1537
-
1538
- # config the profile path
1539
- if self .tizen_profile is not None :
1540
- config_cmd = "%s cli-config -g \" default.profiles.path=%s\" " % (tizen_cmd_path , self .tizen_profile )
1541
- self ._run_cmd (config_cmd )
1542
-
1543
- # invoke tizen package
1544
- build_cfg_path = os .path .join (tizen_proj_path , build_mode )
1545
- if not os .path .isdir (build_cfg_path ):
1546
- raise cocos .CCPluginError (MultiLanguage .get_string ('COMPILE_ERROR_TIZEN_NO_FILE_FMT' , build_cfg_path ))
1547
-
1548
- package_cmd = "%s package -- \" %s\" -t %s" % (tizen_cmd_path , build_cfg_path , self .tizen_pkgtype )
1549
- if self .tizen_sign is not None :
1550
- package_cmd += " -s \" %s\" " % self .tizen_sign
1551
-
1552
- if self .tizen_strip :
1553
- package_cmd += " -S on"
1554
-
1555
- self ._run_cmd (package_cmd )
1556
-
1557
- # get the package path
1558
- from xml .dom import minidom
1559
- doc = minidom .parse (os .path .join (tizen_proj_path , "tizen-manifest.xml" ))
1560
- pkgid = doc .getElementsByTagName ("manifest" )[0 ].getAttribute ("package" )
1561
- version = doc .getElementsByTagName ("manifest" )[0 ].getAttribute ("version" )
1562
-
1563
- if self .tizen_arch == "arm" :
1564
- arch_str = "arm"
1565
- else :
1566
- arch_str = "i386"
1567
-
1568
- pkg_file_name = "%s-%s-%s.%s" % (pkgid , version , arch_str , self .tizen_pkgtype )
1569
- tizen_pkg_path = os .path .join (tizen_proj_path , build_mode , pkg_file_name )
1570
- if not os .path .isfile (tizen_pkg_path ):
1571
- raise cocos .CCPluginError (MultiLanguage .get_string ('COMPILE_ERROR_TIZEN_BUILD_FAILED' ))
1572
-
1573
- # copy the package into output dir
1574
- if not os .path .exists (self ._output_dir ):
1575
- os .makedirs (self ._output_dir )
1576
- shutil .copy (tizen_pkg_path , self ._output_dir )
1577
- self .tizen_pkg_path = os .path .join (self ._output_dir , pkg_file_name )
1578
-
1579
1478
def _get_build_cfg (self ):
1580
1479
build_cfg_dir = self ._build_cfg_path ()
1581
1480
build_cfg = os .path .join (build_cfg_dir , CCPluginCompile .BUILD_CONFIG_FILE )
@@ -1630,7 +1529,6 @@ def run(self, argv, dependencies):
1630
1529
self .build_web ()
1631
1530
self .build_linux ()
1632
1531
self .build_metro ()
1633
- self .build_tizen ()
1634
1532
1635
1533
# invoke the custom step: post-build
1636
1534
self ._project .invoke_custom_step_script (cocos_project .Project .CUSTOM_STEP_POST_BUILD , target_platform , args_build_copy )
0 commit comments