@@ -260,14 +260,6 @@ class AndroidPlatform extends PlatformTarget
260260 AndroidHelper .build (project , destination );
261261 }
262262
263- public override function clean (): Void
264- {
265- if (FileSystem .exists (targetDirectory ))
266- {
267- System .removeDirectory (targetDirectory );
268- }
269- }
270-
271263 public override function deploy (): Void
272264 {
273265 DeploymentHelper .deploy (project , targetFlags , targetDirectory , " Android" );
@@ -301,7 +293,7 @@ class AndroidPlatform extends PlatformTarget
301293 }
302294 }
303295
304- private function getDisplayHXML (): HXML
296+ private override function getDisplayHXML (): HXML
305297 {
306298 var path = targetDirectory + " /haxe/" + buildType + " .hxml" ;
307299
@@ -409,17 +401,6 @@ class AndroidPlatform extends PlatformTarget
409401
410402 // project = project.clone ();
411403
412- for (asset in project .assets )
413- {
414- if (asset .embed && asset .sourcePath == " " )
415- {
416- var path = Path .combine (targetDirectory + " /obj/tmp" , asset .targetPath );
417- System .mkdir (Path .directory (path ));
418- AssetHelper .copyAsset (asset , path );
419- asset .sourcePath = path ;
420- }
421- }
422-
423404 // initialize (project);
424405
425406 var destination = targetDirectory + " /bin" ;
@@ -430,36 +411,6 @@ class AndroidPlatform extends PlatformTarget
430411 System .mkdir (sourceSet + " /res/drawable-hdpi/" );
431412 System .mkdir (sourceSet + " /res/drawable-xhdpi/" );
432413
433- for (asset in project .assets )
434- {
435- if (asset .type != AssetType .TEMPLATE )
436- {
437- var targetPath = " " ;
438-
439- switch (asset .type )
440- {
441- default :
442- // case SOUND, MUSIC:
443-
444- // var extension = Path.extension (asset.sourcePath);
445- // asset.flatName += ((extension != "") ? "." + extension : "");
446-
447- // asset.resourceName = asset.flatName;
448- targetPath = Path .combine (sourceSet + " /assets/" , asset .resourceName );
449-
450- // asset.resourceName = asset.id;
451- // targetPath = sourceSet + "/res/raw/" + asset.flatName + "." + Path.extension (asset.targetPath);
452-
453- // default:
454-
455- // asset.resourceName = asset.flatName;
456- // targetPath = sourceSet + "/assets/" + asset.resourceName;
457- }
458-
459- AssetHelper .copyAssetIfNewer (asset , targetPath );
460- }
461- }
462-
463414 if (project .targetFlags .exists (" xml" ))
464415 {
465416 project .haxeflags .push (" -xml " + targetDirectory + " /types.xml" );
@@ -667,27 +618,12 @@ class AndroidPlatform extends PlatformTarget
667618
668619 for (asset in project .assets )
669620 {
670- if (asset .type = = AssetType .TEMPLATE )
621+ if (asset .type ! = AssetType .TEMPLATE )
671622 {
672- var targetPath = Path .combine (destination , asset .targetPath );
673- System .mkdir (Path .directory (targetPath ));
674- AssetHelper .copyAsset (asset , targetPath , context );
623+ asset .targetPath = asset .resourceName ;
675624 }
676625 }
677- }
678-
679- public override function watch (): Void
680- {
681- var hxml = getDisplayHXML ();
682- var dirs = hxml .getClassPaths (true );
683-
684- var outputPath = Path .combine (Sys .getCwd (), project .app .path );
685- dirs = dirs .filter (function (dir )
686- {
687- return (! Path .startsWith (dir , outputPath ));
688- });
689626
690- var command = ProjectHelper .getCurrentCommand ();
691- System .watch (command , dirs );
627+ copyProjectAssets (destination , sourceSet + " /assets/" );
692628 }
693629}
0 commit comments