Skip to content

Commit

Permalink
update Wwise Archive Function
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterPu committed Dec 13, 2024
1 parent a37ac1c commit f70b1a4
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Platform/Android.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,30 @@ def Package_Wwise(self):

OneWwiseCommand.Build(one_param)

PrintStageLog("Android - Package_Wwise Build Complete")

## Archive
## Final Product
for one_config in list_config:
for one_arch in list_arch:
OneArchiveInfo = ArchiveInfo_WwisePlugin(
WPMHelper.Get().GetName_WwisePluginName(),
WPMHelper.Get().GetVer_Wwise(),
SystemHelper.IOS_TargetName(),
one_config,
one_arch

)
extension = "so"
name_final_product = OneArchiveInfo.GetArchiveName() + "." + extension
path_target_archive_file = WPMHelper.Get().GetPath_WwiseSDKBase() / "Android_" + one_arch / one_config / "lib" / name_final_product
PrintWarn("Src Wwise Final Product [%s]" % path_target_archive_file)
bshould_clean_others_when_archving = False
ArchiveManager.Get().ArchiveBuild(path_target_archive_file,OneArchiveInfo,bshould_clean_others_when_archving,extension)

PrintStageLog("Android - Package_Wwise Archive Complete")


def SetupEnvironment_Wwise(self):
PrintStageLog("SetupEnvironment_Wwise - Android")

Expand Down
20 changes: 19 additions & 1 deletion Platform/IOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,22 @@ def Package_Wwise(self):
one_param_build.platform = platform
OneWwiseCommand.Build(one_param_build)

PrintStageLog("iOS - Package_Wwise Complete")
PrintStageLog("iOS - Package_Wwise Build Complete")

## Archive
## Final Product
for one_config in list_config:
OneArchiveInfo = ArchiveInfo_WwisePlugin(
WPMHelper.Get().GetName_WwisePluginName(),
WPMHelper.Get().GetVer_Wwise(),
SystemHelper.IOS_TargetName(),
one_config
)
extension = "a"
name_final_product = OneArchiveInfo.GetArchiveName() + "." + extension
path_target_archive_file = WPMHelper.Get().GetPath_WwiseSDKBase() / "iOS" /(one_config +"-iphoneos") / "lib" / name_final_product
PrintWarn("Src Wwise Final Product [%s]" % path_target_archive_file)
bshould_clean_others_when_archving = False
ArchiveManager.Get().ArchiveBuild(path_target_archive_file,OneArchiveInfo,bshould_clean_others_when_archving,extension)

PrintStageLog("IOS - Package_Wwise Archive Complete")
23 changes: 22 additions & 1 deletion Platform/Mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,27 @@ def Package_Wwise(self):
one_param_build.platform = platform
OneWwiseCommand.Build(one_param_build)

PrintStageLog("Mac - Package_Wwise Complete")
PrintStageLog("Mac - Package_Wwise Build Complete")

## Archive
## Final Product
for one_config in list_config:
OneArchiveInfo = ArchiveInfo_WwisePlugin(
WPMHelper.Get().GetName_WwisePluginName(),
WPMHelper.Get().GetVer_Wwise(),
SystemHelper.Mac_TargetName(),
one_config
)
extension = "a"
name_final_product = OneArchiveInfo.GetArchiveName() + "." + extension
path_target_archive_file = WPMHelper.Get().GetPath_WwiseSDKBase() / Path("Mac") / one_config / "lib" / name_final_product
PrintWarn("Src Wwise Final Product [%s]" % path_target_archive_file)
bshould_clean_others_when_archving = False
ArchiveManager.Get().ArchiveBuild(path_target_archive_file,OneArchiveInfo,bshould_clean_others_when_archving,extension)

PrintStageLog("Mac - Package_Wwise Archive Complete")





29 changes: 29 additions & 0 deletions Platform/Windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,32 @@ def Package_Wwise(self):
one_param.platform = "Windows_" + one_toolset
OneWwiseCommand.Build(one_param)

PrintStageLog("Win64 - Package_Wwise Build Complete")

## Archive
## Final Product
for one_config in list_config:
for one_toolset in toolset:
OneArchiveInfo = ArchiveInfo_WwisePlugin(
WPMHelper.Get().GetName_WwisePluginName(),
WPMHelper.Get().GetVer_Wwise(),
SystemHelper.Mac_TargetName(),
one_config,
arch,
one_toolset
)
extension = "dll"
name_final_product = OneArchiveInfo.GetArchiveName() + "." + extension
path_target_archive_file = WPMHelper.Get().GetPath_WwiseSDKBase() / OneArchiveInfo.GetArchiveSubDirBasedOnInfo() / "bin" / name_final_product
PrintWarn("Src Wwise Final Product [%s]" % path_target_archive_file)
bshould_clean_others_when_archving = False
ArchiveManager.Get().ArchiveBuild(path_target_archive_file,OneArchiveInfo,bshould_clean_others_when_archving,extension)

extension = "lib"
name_final_product = OneArchiveInfo.GetArchiveName() + "." + extension
path_target_archive_file = WPMHelper.Get().GetPath_WwiseSDKBase() /OneArchiveInfo.GetArchiveSubDirBasedOnInfo() / "bin" / name_final_product
PrintWarn("Src Wwise Final Product [%s]" % path_target_archive_file)
bshould_clean_others_when_archving = False
ArchiveManager.Get().ArchiveBuild(path_target_archive_file,OneArchiveInfo,bshould_clean_others_when_archving,extension)

PrintStageLog("Win64 - Package_Wwise Archive Complete")
45 changes: 45 additions & 0 deletions Utility/ArchiveManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,51 @@ def GetPath_CurRootArchiveDir(self):
def GetArchivePath(self):
return self.GetPath_CurRootArchiveDir()


class ArchiveInfo_WwisePlugin(ArchiveInfoBase):
def __init__(self,PLUGIN_NAME, val_wwisever,val_platform, val_config,val_arch = "",val_toolset = "") -> None:
self.name_plugin = PLUGIN_NAME
self.wwisever = val_wwisever
self.platform = val_platform
self.config = val_config
self.arch = val_arch
self.toolset = val_toolset

def GetPath_CurRootArchiveDirBase(self):
return Path("Archive_WwisePlugin")

def GetPath_CurRootArchiveDir(self):
return self.GetPath_CurRootArchiveDirBase()/ self.wwisever / "ThirdParty"

def GetArchivePath(self):
return self.GetPath_CurRootArchiveDir() / self.GetArchiveSubDirBasedOnInfo()

def GetArchiveSubDirBasedOnInfo(self):
path = ""
if self.platform == SystemHelper.Win64_TargetName():
path = Path("Win64")
path = path / ( self.arch + "_" + self.toolset) / self.config
elif self.platform == SystemHelper.Mac_TargetName():
path = Path("Mac") / self.config
elif self.platform == SystemHelper.IOS_TargetName():
path = Path("IOS") / (self.config + "-iphoneos")
elif self.platform == SystemHelper.Android_TargetName():
path = Path("Android") / self.arch / self.config
return path

def GetArchiveName(self):
name = ""
if self.platform == SystemHelper.Win64_TargetName():
name = self.name_plugin
elif self.platform == SystemHelper.Mac_TargetName():
name = "lib" + self.name_plugin + "Source"
elif self.platform == SystemHelper.IOS_TargetName():
name = "lib" + self.name_plugin + "Source"
elif self.platform == SystemHelper.Android_TargetName():
name = "lib" + self.name_plugin

return name

class ArchiveManager:
__instance = None

Expand Down
3 changes: 3 additions & 0 deletions WPMHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def GetPath_WwiseWPScript(self):
def GetPath_WwiseSDKBase(self):
return self.GetPath_WwiseBase() / Path("SDK")

def GetVer_Wwise(self):
return self.__Args.wwisever

def GetName_WwisePluginName(self):
return self.__Args.wwisepluginname

Expand Down

0 comments on commit f70b1a4

Please sign in to comment.