-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
342 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
from Command.CommandBase import * | ||
from pathlib import Path | ||
|
||
|
||
class ParamsWwise: | ||
def __init__(self) -> None: | ||
self.__path_wp = "" | ||
|
||
@property | ||
def get_path_wp(self): | ||
return self.__path_wp | ||
@get_path_wp.setter | ||
def path_wp(self,val): | ||
self.__path_wp = val | ||
|
||
|
||
class ParamsWwisePluginBuild: | ||
def __init__(self) -> None: | ||
self.__path_wp = "" | ||
|
||
@property | ||
def get_path_wp(self): | ||
return self.__path_wp | ||
@get_path_wp.setter | ||
def path_wp(self,val): | ||
self.__path_wp = val | ||
|
||
@property | ||
def get_configuration(self): | ||
return self.__configuration | ||
|
||
@get_configuration.setter | ||
def config(self,val): | ||
self.__configuration = val | ||
|
||
@property | ||
def get_platform(self): | ||
return self.__platform | ||
|
||
@get_platform.setter | ||
def platform(self,val): | ||
self.__platform = val | ||
|
||
@property | ||
def get_architecture(self): | ||
return self.__architecture | ||
|
||
@get_architecture.setter | ||
def arch(self,val): | ||
self.__architecture = val | ||
|
||
@property | ||
def get_toolset(self): | ||
return self.__toolset | ||
|
||
@get_toolset.setter | ||
def toolset(self,val): | ||
self.__toolset = val | ||
|
||
@property | ||
def get_subcommand(self): | ||
subcommand = "" | ||
|
||
if self.__configuration != "": | ||
subcommand += " -c " + self.__configuration | ||
if self.__architecture != "": | ||
subcommand += " -x " + self.__architecture | ||
if self.__toolset != "": | ||
subcommand += " -t " + self.__toolset | ||
if self.__platform != "": | ||
subcommand += " " + self.__platform | ||
|
||
return subcommand | ||
|
||
|
||
class WwiseCommand: | ||
|
||
def Premake(self,params:ParamsWwise): | ||
path_wp = params.get_path_wp | ||
default = "Authoring" | ||
command = ( | ||
'" python ' + str(path_wp) + '"' + " premake" | ||
) | ||
RUNCMD(command) | ||
|
||
def Build(self,params:ParamsWwisePluginBuild): | ||
path_wp = params.get_path_wp | ||
subcommand = params.get_subcommand | ||
command = ( | ||
'" python ' + str(path_wp) + '"' + " build " + subcommand | ||
) | ||
RUNCMD(command) | ||
|
||
pass | ||
|
||
# ``` | ||
# python "C:\Program Files (x86)\Audiokinetic\Wwise 2023.1.6.8555\Scripts\Build\Plugins\wp.py" build -c Profile -x x64 -t vc160 Windows_vc160 | ||
# ``` | ||
|
||
# ``` | ||
# python "C:\Program Files (x86)\Audiokinetic\Wwise 2023.1.6.8555\Scripts\Build\Plugins\wp.py" build -c Debug -x arm64-v8a Android | ||
# ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class _template_helper: | ||
__instance = None | ||
__initialized = False | ||
|
||
def __new__(cls, *args, **kwargs): | ||
if not cls.__instance: | ||
cls.__instance = super().__new__(cls, *args, **kwargs) | ||
cls.__instance.__initialized = False | ||
return cls.__instance | ||
|
||
def __init__(self) -> None: | ||
if not self.__initialized: | ||
super().__init__() | ||
|
||
## Init | ||
|
||
self.__initialized = True | ||
|
||
|
||
def Get(): | ||
return _template_helper() | ||
|
||
def Init(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from Utility.HeaderBase import * | ||
import argparse | ||
|
||
class _template_mananger_(): | ||
__instance = None | ||
__initialized = False | ||
|
||
def __new__(cls, *args, **kwargs): | ||
if not cls.__instance: | ||
cls.__instance = super().__new__(cls, *args, **kwargs) | ||
cls.__instance.__initialized = False | ||
return cls.__instance | ||
|
||
def __init__(self) -> None: | ||
if not self.__initialized: | ||
super().__init__() | ||
self.__initialized = True | ||
|
||
def Get(): | ||
return _template_mananger_() | ||
|
||
|
||
def ParseCMDArgs(self): | ||
ArgParser = argparse.ArgumentParser(description="Parse _template_mananger_ Args") | ||
|
||
self.AddArgsToParser(ArgParser) | ||
|
||
Args = ArgParser.parse_args() | ||
|
||
PrintLog(Args) | ||
return Args | ||
|
||
def AddArgsToParser(self,ArgParser, bIncludeConflictArgs = True): | ||
ArgParser.add_argument('-wwisever',default="2024.1.0.8669") | ||
if bIncludeConflictArgs: | ||
pass | ||
|
||
def Init(self): | ||
PrintStageLog("_template_mananger_ Init") | ||
|
||
def Start(self): | ||
_template_mananger_.Get().Init() | ||
args = self.ParseCMDArgs() | ||
self.CreateTask(args) | ||
|
||
def CreateTask(self,Args): | ||
pass | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
_template_mananger_.Get().Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from Utility.HeaderBase import * | ||
import argparse | ||
from WPMHelper import * | ||
|
||
class WwisePluginManager(): | ||
__instance = None | ||
__initialized = False | ||
|
||
def __new__(cls, *args, **kwargs): | ||
if not cls.__instance: | ||
cls.__instance = super().__new__(cls, *args, **kwargs) | ||
cls.__instance.__initialized = False | ||
return cls.__instance | ||
|
||
def __init__(self) -> None: | ||
if not self.__initialized: | ||
super().__init__() | ||
self.__initialized = True | ||
|
||
def Get(): | ||
return WwisePluginManager() | ||
|
||
|
||
def ParseCMDArgs(self): | ||
ArgParser = argparse.ArgumentParser(description="Parse Wwise Plugin Manager Args") | ||
|
||
self.AddArgsToParser(ArgParser) | ||
|
||
Args = ArgParser.parse_args() | ||
|
||
PrintLog(Args) | ||
return Args | ||
|
||
def AddArgsToParser(self,ArgParser, bIncludeConflictArgs = True): | ||
default_targetsystem = self.GetHostPlatform() | ||
if default_targetsystem == SystemHelper.Win_HostName(): | ||
default_targetsystem = SystemHelper.Win64_TargetName() | ||
|
||
ArgParser.add_argument('-wwisever',default="2021.1.14.8108") | ||
ArgParser.add_argument('-pathwwisebase',default="") | ||
ArgParser.add_argument('-wpprojectpath',default="") | ||
if bIncludeConflictArgs: | ||
ArgParser.add_argument("-targetplatform", default=SystemHelper.Get().GetTargetPlatform_BasedOnHostPlatform()) | ||
|
||
def Init(self): | ||
PrintStageLog("WwisePluginManager Init") | ||
|
||
def Start(self): | ||
WwisePluginManager.Get().Init() | ||
args = self.ParseCMDArgs() | ||
WPMHelper.Get().Init(args) | ||
self.CreateTask(args) | ||
|
||
def CreateTask(self): | ||
self.BuildWwisePlugin() | ||
|
||
|
||
def BuildWwisePlugin(self): | ||
Args = WPMHelper.Get().GetArgs() | ||
type_hostplatform = SystemHelper.Get().GetHostPlatform() | ||
ret_host,host_platform = CreateHostPlatform(type_hostplatform,Args) | ||
target_platform_type_list = ParsePlatformArg(Args.targetplatform) | ||
for target_platform_type in target_platform_type_list: | ||
ret_target,target_platform = CreateTargetPlatform(host_platform,target_platform_type,Args) | ||
if ret_target == True: | ||
target_platform.Package_Wwwise() | ||
else: | ||
PrintErr("Invalid TargetPlatform Creation") | ||
|
||
|
||
if __name__ == '__main__': | ||
WwisePluginManager.Get().Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from SystemHelper import * | ||
from pathlib import Path | ||
class WPMHelper: | ||
__instance = None | ||
__initialized = False | ||
__Args = None | ||
|
||
def __new__(cls, *args, **kwargs): | ||
if not cls.__instance: | ||
cls.__instance = super().__new__(cls, *args, **kwargs) | ||
cls.__instance.__initialized = False | ||
return cls.__instance | ||
|
||
def __init__(self) -> None: | ||
if not self.__initialized: | ||
super().__init__() | ||
|
||
## Init | ||
|
||
self.__initialized = True | ||
|
||
|
||
def Get(): | ||
return WPMHelper() | ||
|
||
def Init(self,Args): | ||
self.__Args = Args | ||
|
||
|
||
def GetArgs(self): | ||
return self.__Args | ||
|
||
|
||
def GetPath_WwiseBase(self): | ||
path_wwise_base = self.__Args.pathwwisebase | ||
if path_wwise_base == "": | ||
if SystemHelper.GetHostPlatform() == SystemHelper.Mac_HostName(): | ||
path_wwise_base = Path("/Applications/Audiokinetic") | ||
|
||
elif SystemHelper.GetHostPlatform() == SystemHelper.Win_HostName(): | ||
path_wwise_base = Path("C:\Program Files (x86)\Audiokinetic") | ||
|
||
ver_wwise = self.__Args.wwisever | ||
|
||
path_wwise_ver = str("Wwise") + str(ver_wwise) | ||
|
||
path_wwise_base = path_wwise_base / path_wwise_ver | ||
|
||
return path_wwise_base | ||
|
||
|
||
def GetPath_WwiseWPScript(self): | ||
return self.GetPath_WwiseBase() / Path("Scripts/Build/Plugins/wp.py") | ||
|
||
|
||
def GetPath_WwiseSDKBase(self): | ||
return self.GetPath_WwiseBase() / Path("SDK") | ||
|
||
|
||
|