mirror of https://github.com/axmolengine/axmol.git
fixed #225 Create new project from main menu ok.
Signed-off-by: yangws <yangws@cocos2d-x.org>
This commit is contained in:
parent
8c079cb89f
commit
462a8baf33
|
@ -27,21 +27,6 @@ function OnFinish(selProj, selObj) {
|
||||||
wizard.AddSymbol("CCX_CURRENT_YEAR", nYear);
|
wizard.AddSymbol("CCX_CURRENT_YEAR", nYear);
|
||||||
wizard.AddSymbol("CCX_CURRENT_DATE", d.toString());
|
wizard.AddSymbol("CCX_CURRENT_DATE", d.toString());
|
||||||
|
|
||||||
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
|
|
||||||
var strUserTarget = strProjectName + ".uphone.vcproj.user";
|
|
||||||
var strUserPath = FileSys.BuildPath(strProjectPath, strUserTarget);
|
|
||||||
|
|
||||||
if (!FileSys.FolderExists(strProjectPath))
|
|
||||||
FileSys.CreateFolder(strProjectPath);
|
|
||||||
|
|
||||||
var file = FileSys.OpenTextFile(strUserPath, 2, true);
|
|
||||||
if (file == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?><VisualStudioUserFile ProjectType=\"Visual C++\" Version=\"9.00\" ShowAllFiles=\"true\"><Configurations><Configuration Name=\"Debug|Win32\"><DebugSettings Command=\"TG3_RunDLL.exe\" CommandArguments=\"$(TargetPath)\"/></Configuration></VisualStudioUserFile>";
|
|
||||||
file.WriteLine(strUserValue);
|
|
||||||
file.Close();
|
|
||||||
|
|
||||||
selProj = CreateCustomProject(strProjectName, strProjectPath);
|
selProj = CreateCustomProject(strProjectName, strProjectPath);
|
||||||
AddConfig(selProj, strProjectName);
|
AddConfig(selProj, strProjectName);
|
||||||
AddFilters(selProj);
|
AddFilters(selProj);
|
||||||
|
@ -77,6 +62,35 @@ function CreateCustomProject(strProjectName, strProjectPath) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create vcproj.user file
|
||||||
|
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
|
||||||
|
var strUserTarget = strProjectName + ".uphone.vcproj.user";
|
||||||
|
var strUserPath = FileSys.BuildPath(strProjectPath, strUserTarget);
|
||||||
|
|
||||||
|
var astrParentPath = new Array();
|
||||||
|
astrParentPath[0] = strProjectPath;
|
||||||
|
while (astrParentPath.length) {
|
||||||
|
var strPath = astrParentPath.pop();
|
||||||
|
var strParentPath = FileSys.GetParentFolderName(strPath);
|
||||||
|
|
||||||
|
if (!FileSys.FolderExists(strParentPath)) {
|
||||||
|
astrParentPath.push(strPath);
|
||||||
|
astrParentPath.push(strParentPath);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
FileSys.CreateFolder(strPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var file = FileSys.OpenTextFile(strUserPath, 2, true);
|
||||||
|
if (file == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?><VisualStudioUserFile ProjectType=\"Visual C++\" Version=\"9.00\" ShowAllFiles=\"true\"><Configurations><Configuration Name=\"Debug|Win32\"><DebugSettings Command=\"TG3_RunDLL.exe\" CommandArguments=\"$(TargetPath)\"/></Configuration></VisualStudioUserFile>";
|
||||||
|
file.WriteLine(strUserValue);
|
||||||
|
file.Close();
|
||||||
|
|
||||||
var strProjectNameWithExt = '';
|
var strProjectNameWithExt = '';
|
||||||
strProjectNameWithExt = strProjectName + '.uphone.vcproj';
|
strProjectNameWithExt = strProjectName + '.uphone.vcproj';
|
||||||
|
|
||||||
|
|
|
@ -1,128 +1,126 @@
|
||||||
function OnFinish(selProj, selObj)
|
function OnFinish(selProj, selObj) {
|
||||||
{
|
try {
|
||||||
try
|
var strProjectPath = wizard.FindSymbol('PROJECT_PATH');
|
||||||
{
|
var strProjectName = wizard.FindSymbol('PROJECT_NAME');
|
||||||
var strProjectPath = wizard.FindSymbol('PROJECT_PATH');
|
|
||||||
var strProjectName = wizard.FindSymbol('PROJECT_NAME');
|
|
||||||
|
|
||||||
// var WizardVersion = wizard.FindSymbol('WIZARD_VERSION');
|
// var WizardVersion = wizard.FindSymbol('WIZARD_VERSION');
|
||||||
// if(WizardVersion >= 8.0)
|
// if(WizardVersion >= 8.0)
|
||||||
// {
|
// {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Create symbols based on the project name
|
// Create symbols based on the project name
|
||||||
var strSafeProjectName = CreateSafeName(strProjectName);
|
var strSafeProjectName = CreateSafeName(strProjectName);
|
||||||
wizard.AddSymbol("SAFE_PROJECT_NAME", strSafeProjectName);
|
wizard.AddSymbol("SAFE_PROJECT_NAME", strSafeProjectName);
|
||||||
wizard.AddSymbol("NICE_SAFE_PROJECT_NAME", strSafeProjectName.substr(0, 1).toUpperCase() + strSafeProjectName.substr(1))
|
wizard.AddSymbol("NICE_SAFE_PROJECT_NAME", strSafeProjectName.substr(0, 1).toUpperCase() + strSafeProjectName.substr(1))
|
||||||
wizard.AddSymbol("UPPERCASE_SAFE_PROJECT_NAME", strSafeProjectName.toUpperCase());
|
wizard.AddSymbol("UPPERCASE_SAFE_PROJECT_NAME", strSafeProjectName.toUpperCase());
|
||||||
|
|
||||||
// Set current year symbol
|
// Set current year symbol
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var nYear = 0;
|
var nYear = 0;
|
||||||
nYear = d.getFullYear();
|
nYear = d.getFullYear();
|
||||||
if(nYear >= 2003)
|
if (nYear >= 2003)
|
||||||
wizard.AddSymbol("CCX_CURRENT_YEAR", nYear);
|
wizard.AddSymbol("CCX_CURRENT_YEAR", nYear);
|
||||||
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
|
// Create project and configurations
|
||||||
|
selProj = CreateCustomProject(strProjectName, strProjectPath);
|
||||||
|
AddConfigurations(selProj, strProjectName);
|
||||||
|
AddFilters(selProj);
|
||||||
|
|
||||||
|
var InfFile = CreateCustomInfFile();
|
||||||
|
AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile);
|
||||||
|
AddPchSettings(selProj);
|
||||||
|
InfFile.Delete();
|
||||||
|
|
||||||
|
selProj.Object.Save();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
if (e.description.length != 0)
|
||||||
|
SetErrorInfo(e);
|
||||||
|
return e.number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CreateCustomProject(strProjectName, strProjectPath) {
|
||||||
|
try {
|
||||||
|
var strProjTemplatePath = wizard.FindSymbol('PROJECT_TEMPLATE_PATH');
|
||||||
|
var strProjTemplate = '';
|
||||||
|
strProjTemplate = strProjTemplatePath + '\\default.vcproj';
|
||||||
|
|
||||||
|
var Solution = dte.Solution;
|
||||||
|
var strSolutionName = "";
|
||||||
|
if (wizard.FindSymbol("CLOSE_SOLUTION")) {
|
||||||
|
Solution.Close();
|
||||||
|
strSolutionName = wizard.FindSymbol("VS_SOLUTION_NAME");
|
||||||
|
if (strSolutionName.length) {
|
||||||
|
var strSolutionPath = strProjectPath.substr(0, strProjectPath.length - strProjectName.length);
|
||||||
|
Solution.Create(strSolutionPath, strSolutionName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create vcproj.user file
|
||||||
|
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
|
||||||
var strUserTarget = strProjectName + ".win32.vcproj.user";
|
var strUserTarget = strProjectName + ".win32.vcproj.user";
|
||||||
var strUserPath = FileSys.BuildPath(strProjectPath, strUserTarget);
|
var strUserPath = FileSys.BuildPath(strProjectPath, strUserTarget);
|
||||||
|
|
||||||
if (!FileSys.FolderExists(strProjectPath))
|
var astrParentPath = new Array();
|
||||||
FileSys.CreateFolder(strProjectPath);
|
astrParentPath[0] = strProjectPath;
|
||||||
|
while (astrParentPath.length) {
|
||||||
|
var strPath = astrParentPath.pop();
|
||||||
|
var strParentPath = FileSys.GetParentFolderName(strPath);
|
||||||
|
|
||||||
var file = FileSys.OpenTextFile(strUserPath, 2, true);
|
if (!FileSys.FolderExists(strParentPath)) {
|
||||||
if (file == null)
|
astrParentPath.push(strPath);
|
||||||
{
|
astrParentPath.push(strParentPath);
|
||||||
return;
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
FileSys.CreateFolder(strPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var file = FileSys.OpenTextFile(strUserPath, 2, true);
|
||||||
var strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?><VisualStudioUserFile ProjectType=\"Visual C++\" Version=\"9.00\" ShowAllFiles=\"true\"></VisualStudioUserFile>";
|
var strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?><VisualStudioUserFile ProjectType=\"Visual C++\" Version=\"9.00\" ShowAllFiles=\"true\"></VisualStudioUserFile>";
|
||||||
file.WriteLine(strUserValue);
|
file.WriteLine(strUserValue);
|
||||||
file.Close();
|
file.Close();
|
||||||
|
|
||||||
// Create project and configurations
|
var strProjectNameWithExt = '';
|
||||||
selProj = CreateCustomProject(strProjectName, strProjectPath);
|
strProjectNameWithExt = strProjectName + '.win32.vcproj';
|
||||||
AddConfigurations(selProj, strProjectName);
|
|
||||||
AddFilters(selProj);
|
|
||||||
|
|
||||||
var InfFile = CreateCustomInfFile();
|
var oTarget = wizard.FindSymbol("TARGET");
|
||||||
AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile);
|
var prj;
|
||||||
AddPchSettings(selProj);
|
if (wizard.FindSymbol("WIZARD_TYPE") == vsWizardAddSubProject) // vsWizardAddSubProject
|
||||||
InfFile.Delete();
|
{
|
||||||
|
var prjItem = oTarget.AddFromTemplate(strProjTemplate, strProjectNameWithExt);
|
||||||
selProj.Object.Save();
|
prj = prjItem.SubProject;
|
||||||
|
}
|
||||||
}
|
else {
|
||||||
catch(e)
|
prj = oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt);
|
||||||
{
|
}
|
||||||
if (e.description.length != 0)
|
return prj;
|
||||||
SetErrorInfo(e);
|
}
|
||||||
return e.number;
|
catch (e) {
|
||||||
}
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function CreateCustomProject(strProjectName, strProjectPath)
|
function AddFilters(proj) {
|
||||||
{
|
try {
|
||||||
try
|
// Add the folders to your project
|
||||||
{
|
var strSrcFilter = wizard.FindSymbol('SOURCE_FILTER');
|
||||||
var strProjTemplatePath = wizard.FindSymbol('PROJECT_TEMPLATE_PATH');
|
var group = proj.Object.AddFilter('source');
|
||||||
var strProjTemplate = '';
|
group.Filter = strSrcFilter;
|
||||||
strProjTemplate = strProjTemplatePath + '\\default.vcproj';
|
|
||||||
|
|
||||||
var Solution = dte.Solution;
|
strSrcFilter = wizard.FindSymbol('INCLUDE_FILTER');
|
||||||
var strSolutionName = "";
|
group = proj.Object.AddFilter('include');
|
||||||
if (wizard.FindSymbol("CLOSE_SOLUTION"))
|
group.Filter = strSrcFilter;
|
||||||
{
|
|
||||||
Solution.Close();
|
|
||||||
strSolutionName = wizard.FindSymbol("VS_SOLUTION_NAME");
|
|
||||||
if (strSolutionName.length)
|
|
||||||
{
|
|
||||||
var strSolutionPath = strProjectPath.substr(0, strProjectPath.length - strProjectName.length);
|
|
||||||
Solution.Create(strSolutionPath, strSolutionName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var strProjectNameWithExt = '';
|
strSrcFilter = wizard.FindSymbol('RESOURCE_FILTER');
|
||||||
strProjectNameWithExt = strProjectName + '.win32.vcproj';
|
group = proj.Object.AddFilter('resource');
|
||||||
|
group.Filter = strSrcFilter;
|
||||||
var oTarget = wizard.FindSymbol("TARGET");
|
}
|
||||||
var prj;
|
catch (e) {
|
||||||
if (wizard.FindSymbol("WIZARD_TYPE") == vsWizardAddSubProject) // vsWizardAddSubProject
|
throw e;
|
||||||
{
|
}
|
||||||
var prjItem = oTarget.AddFromTemplate(strProjTemplate, strProjectNameWithExt);
|
|
||||||
prj = prjItem.SubProject;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
prj = oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt);
|
|
||||||
}
|
|
||||||
return prj;
|
|
||||||
}
|
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function AddFilters(proj)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Add the folders to your project
|
|
||||||
var strSrcFilter = wizard.FindSymbol('SOURCE_FILTER');
|
|
||||||
var group = proj.Object.AddFilter('source');
|
|
||||||
group.Filter = strSrcFilter;
|
|
||||||
|
|
||||||
strSrcFilter = wizard.FindSymbol('INCLUDE_FILTER');
|
|
||||||
group = proj.Object.AddFilter('include');
|
|
||||||
group.Filter = strSrcFilter;
|
|
||||||
|
|
||||||
strSrcFilter = wizard.FindSymbol('RESOURCE_FILTER');
|
|
||||||
group = proj.Object.AddFilter('resource');
|
|
||||||
group.Filter = strSrcFilter;
|
|
||||||
}
|
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,266 +131,233 @@ var astrConfigName = new Array();
|
||||||
astrConfigName[0] = "Debug";
|
astrConfigName[0] = "Debug";
|
||||||
astrConfigName[1] = "Release";
|
astrConfigName[1] = "Release";
|
||||||
|
|
||||||
function AddConfigurations(proj, strProjectName)
|
function AddConfigurations(proj, strProjectName) {
|
||||||
{
|
try {
|
||||||
try
|
var nCntr;
|
||||||
{
|
for (nCntr = 0; nCntr < nNumConfigs; nCntr++) {
|
||||||
var nCntr;
|
// Check if it's Debug configuration
|
||||||
for(nCntr = 0; nCntr < nNumConfigs; nCntr++)
|
var bDebug = false;
|
||||||
{
|
if (astrConfigName[nCntr].search("Debug") != -1)
|
||||||
// Check if it's Debug configuration
|
bDebug = true;
|
||||||
var bDebug = false;
|
|
||||||
if(astrConfigName[nCntr].search("Debug") != -1)
|
|
||||||
bDebug = true;
|
|
||||||
|
|
||||||
// General settings
|
// General settings
|
||||||
var config = proj.Object.Configurations(astrConfigName[nCntr]);
|
var config = proj.Object.Configurations(astrConfigName[nCntr]);
|
||||||
|
|
||||||
// if(wizard.FindSymbol("CCX_USE_UNICODE"))
|
// if(wizard.FindSymbol("CCX_USE_UNICODE"))
|
||||||
config.CharacterSet = charSetUnicode;
|
config.CharacterSet = charSetUnicode;
|
||||||
// else
|
// else
|
||||||
// config.CharacterSet = charSetMBCS;
|
// config.CharacterSet = charSetMBCS;
|
||||||
|
|
||||||
config.OutputDirectory = '$(SolutionDir)$(ConfigurationName).win32'
|
config.OutputDirectory = '$(SolutionDir)$(ConfigurationName).win32'
|
||||||
config.IntermediateDirectory = '$(ConfigurationName).win32';
|
config.IntermediateDirectory = '$(ConfigurationName).win32';
|
||||||
|
|
||||||
// Compiler settings
|
// Compiler settings
|
||||||
var CLTool = config.Tools('VCCLCompilerTool');
|
var CLTool = config.Tools('VCCLCompilerTool');
|
||||||
|
|
||||||
// Additional Inlcude Directories
|
// Additional Inlcude Directories
|
||||||
var strAddIncludeDir = '.;.\\win32;.\\Classes;..\\cocos2dx;..\\cocos2dx\\include;..\\cocos2dx\\platform\\win32\\third_party\\OGLES';
|
var strAddIncludeDir = '.;.\\win32;.\\Classes;..\\cocos2dx;..\\cocos2dx\\include;..\\cocos2dx\\platform\\win32\\third_party\\OGLES';
|
||||||
if (wizard.FindSymbol('CCX_USE_BOX2D'))
|
if (wizard.FindSymbol('CCX_USE_BOX2D')) {
|
||||||
{
|
strAddIncludeDir += ';..\\;..\\Box2D';
|
||||||
strAddIncludeDir += ';..\\;..\\Box2D';
|
}
|
||||||
}
|
if (wizard.FindSymbol('CCX_USE_CHIPMUNK')) {
|
||||||
if (wizard.FindSymbol('CCX_USE_CHIPMUNK'))
|
strAddIncludeDir += ';..\\chipmunk\\include\\chipmunk';
|
||||||
{
|
}
|
||||||
strAddIncludeDir += ';..\\chipmunk\\include\\chipmunk';
|
if (wizard.FindSymbol('CCX_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE')) {
|
||||||
}
|
strAddIncludeDir += ';..\\CocosDenshion\\Include';
|
||||||
if (wizard.FindSymbol('CCX_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE'))
|
}
|
||||||
{
|
CLTool.AdditionalIncludeDirectories = strAddIncludeDir;
|
||||||
strAddIncludeDir += ';..\\CocosDenshion\\Include';
|
|
||||||
}
|
|
||||||
CLTool.AdditionalIncludeDirectories = strAddIncludeDir;
|
|
||||||
|
|
||||||
CLTool.UsePrecompiledHeader = pchNone; // pchUseUsingSpecific;
|
CLTool.UsePrecompiledHeader = pchNone; // pchUseUsingSpecific;
|
||||||
CLTool.WarningLevel = warningLevel_3;
|
CLTool.WarningLevel = warningLevel_3;
|
||||||
if(bDebug)
|
if (bDebug) {
|
||||||
{
|
CLTool.RuntimeLibrary = rtMultiThreadedDebug;
|
||||||
CLTool.RuntimeLibrary = rtMultiThreadedDebug;
|
CLTool.MinimalRebuild = true;
|
||||||
CLTool.MinimalRebuild = true;
|
CLTool.DebugInformationFormat = debugEditAndContinue;
|
||||||
CLTool.DebugInformationFormat = debugEditAndContinue;
|
CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
|
||||||
CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
|
CLTool.Optimization = optimizeDisabled;
|
||||||
CLTool.Optimization = optimizeDisabled;
|
}
|
||||||
}
|
else {
|
||||||
else
|
CLTool.RuntimeLibrary = rtMultiThreaded;
|
||||||
{
|
CLTool.ExceptionHandling = false;
|
||||||
CLTool.RuntimeLibrary = rtMultiThreaded;
|
CLTool.DebugInformationFormat = debugDisabled;
|
||||||
CLTool.ExceptionHandling = false;
|
}
|
||||||
CLTool.DebugInformationFormat = debugDisabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
var strDefines = GetPlatformDefine(config);
|
var strDefines = GetPlatformDefine(config);
|
||||||
strDefines += "_WINDOWS;STRICT;";
|
strDefines += "_WINDOWS;STRICT;";
|
||||||
if(bDebug)
|
if (bDebug)
|
||||||
strDefines += "_DEBUG";
|
strDefines += "_DEBUG";
|
||||||
else
|
else
|
||||||
strDefines += "NDEBUG";
|
strDefines += "NDEBUG";
|
||||||
CLTool.PreprocessorDefinitions = strDefines;
|
CLTool.PreprocessorDefinitions = strDefines;
|
||||||
|
|
||||||
// Disable special warning
|
// Disable special warning
|
||||||
CLTool.DisableSpecificWarnings = "4251";
|
CLTool.DisableSpecificWarnings = "4251";
|
||||||
|
|
||||||
// Linker settings
|
// Linker settings
|
||||||
var LinkTool = config.Tools('VCLinkerTool');
|
var LinkTool = config.Tools('VCLinkerTool');
|
||||||
LinkTool.SubSystem = subSystemWindows;
|
LinkTool.SubSystem = subSystemWindows;
|
||||||
LinkTool.TargetMachine = machineX86;
|
LinkTool.TargetMachine = machineX86;
|
||||||
if(bDebug)
|
if (bDebug) {
|
||||||
{
|
LinkTool.LinkIncremental = linkIncrementalYes;
|
||||||
LinkTool.LinkIncremental = linkIncrementalYes;
|
LinkTool.GenerateDebugInformation = true;
|
||||||
LinkTool.GenerateDebugInformation = true;
|
}
|
||||||
}
|
else {
|
||||||
else
|
LinkTool.LinkIncremental = linkIncrementalNo;
|
||||||
{
|
}
|
||||||
LinkTool.LinkIncremental = linkIncrementalNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Additional Library Directories
|
// Additional Library Directories
|
||||||
var strAddDepends = 'libcocos2d.lib libgles_cm.lib';
|
var strAddDepends = 'libcocos2d.lib libgles_cm.lib';
|
||||||
if (wizard.FindSymbol('CCX_USE_BOX2D'))
|
if (wizard.FindSymbol('CCX_USE_BOX2D')) {
|
||||||
{
|
|
||||||
strAddDepends += ' libBox2d.lib';
|
strAddDepends += ' libBox2d.lib';
|
||||||
}
|
}
|
||||||
if (wizard.FindSymbol('CCX_USE_CHIPMUNK'))
|
if (wizard.FindSymbol('CCX_USE_CHIPMUNK')) {
|
||||||
{
|
strAddDepends += ' libchipmunk.lib';
|
||||||
strAddDepends +=' libchipmunk.lib';
|
}
|
||||||
}
|
if (wizard.FindSymbol('CCX_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE')) {
|
||||||
if (wizard.FindSymbol('CCX_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE'))
|
strAddDepends += ' libCocosDenshion.lib';
|
||||||
{
|
}
|
||||||
strAddDepends += ' libCocosDenshion.lib';
|
LinkTool.AdditionalLibraryDirectories = '$(OutDir)';
|
||||||
}
|
|
||||||
LinkTool.AdditionalLibraryDirectories = '$(OutDir)';
|
|
||||||
LinkTool.AdditionalDependencies = strAddDepends;
|
LinkTool.AdditionalDependencies = strAddDepends;
|
||||||
|
|
||||||
// Resource settings
|
// Resource settings
|
||||||
var RCTool = config.Tools("VCResourceCompilerTool");
|
var RCTool = config.Tools("VCResourceCompilerTool");
|
||||||
RCTool.Culture = rcEnglishUS;
|
RCTool.Culture = rcEnglishUS;
|
||||||
RCTool.AdditionalIncludeDirectories = "$(IntDir)";
|
RCTool.AdditionalIncludeDirectories = "$(IntDir)";
|
||||||
if(bDebug)
|
if (bDebug)
|
||||||
RCTool.PreprocessorDefinitions = "_DEBUG";
|
RCTool.PreprocessorDefinitions = "_DEBUG";
|
||||||
else
|
else
|
||||||
RCTool.PreprocessorDefinitions = "NDEBUG";
|
RCTool.PreprocessorDefinitions = "NDEBUG";
|
||||||
|
|
||||||
// MIDL settings
|
// MIDL settings
|
||||||
var MidlTool = config.Tools("VCMidlTool");
|
var MidlTool = config.Tools("VCMidlTool");
|
||||||
MidlTool.MkTypLibCompatible = false;
|
MidlTool.MkTypLibCompatible = false;
|
||||||
if(IsPlatformWin32(config))
|
if (IsPlatformWin32(config))
|
||||||
MidlTool.TargetEnvironment = midlTargetWin32;
|
MidlTool.TargetEnvironment = midlTargetWin32;
|
||||||
if(bDebug)
|
if (bDebug)
|
||||||
MidlTool.PreprocessorDefinitions = "_DEBUG";
|
MidlTool.PreprocessorDefinitions = "_DEBUG";
|
||||||
else
|
else
|
||||||
MidlTool.PreprocessorDefinitions = "NDEBUG";
|
MidlTool.PreprocessorDefinitions = "NDEBUG";
|
||||||
MidlTool.HeaderFileName = strProjectName + ".h";
|
MidlTool.HeaderFileName = strProjectName + ".h";
|
||||||
MidlTool.InterfaceIdentifierFileName = strProjectName + "_i.c";
|
MidlTool.InterfaceIdentifierFileName = strProjectName + "_i.c";
|
||||||
MidlTool.ProxyFileName = strProjectName + "_p.c";
|
MidlTool.ProxyFileName = strProjectName + "_p.c";
|
||||||
MidlTool.GenerateStublessProxies = true;
|
MidlTool.GenerateStublessProxies = true;
|
||||||
MidlTool.TypeLibraryName = "$(IntDir)/" + strProjectName + ".tlb";
|
MidlTool.TypeLibraryName = "$(IntDir)/" + strProjectName + ".tlb";
|
||||||
MidlTool.DLLDataFileName = "";
|
MidlTool.DLLDataFileName = "";
|
||||||
|
|
||||||
// Post-build settings
|
// Post-build settings
|
||||||
// var PostBuildTool = config.Tools("VCPostBuildEventTool");
|
// var PostBuildTool = config.Tools("VCPostBuildEventTool");
|
||||||
// PostBuildTool.Description = "Performing registration...";
|
// PostBuildTool.Description = "Performing registration...";
|
||||||
// PostBuildTool.CommandLine = "\"$(TargetPath)\" /RegServer";
|
// PostBuildTool.CommandLine = "\"$(TargetPath)\" /RegServer";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(e)
|
catch (e) {
|
||||||
{
|
throw e;
|
||||||
throw e;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddPchSettings(proj)
|
function AddPchSettings(proj) {
|
||||||
{
|
try {
|
||||||
try
|
// var files = proj.Object.Files;
|
||||||
{
|
// var fStdafx = files("StdAfx.cpp");
|
||||||
// var files = proj.Object.Files;
|
//
|
||||||
// var fStdafx = files("StdAfx.cpp");
|
// var nCntr;
|
||||||
//
|
// for(nCntr = 0; nCntr < nNumConfigs; nCntr++)
|
||||||
// var nCntr;
|
// {
|
||||||
// for(nCntr = 0; nCntr < nNumConfigs; nCntr++)
|
// var config = fStdafx.FileConfigurations(astrConfigName[nCntr]);
|
||||||
// {
|
// config.Tool.UsePrecompiledHeader = pchCreateUsingSpecific;
|
||||||
// var config = fStdafx.FileConfigurations(astrConfigName[nCntr]);
|
// }
|
||||||
// config.Tool.UsePrecompiledHeader = pchCreateUsingSpecific;
|
}
|
||||||
// }
|
catch (e) {
|
||||||
}
|
throw e;
|
||||||
catch(e)
|
}
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function DelFile(fso, strWizTempFile)
|
function DelFile(fso, strWizTempFile) {
|
||||||
{
|
try {
|
||||||
try
|
if (fso.FileExists(strWizTempFile)) {
|
||||||
{
|
var tmpFile = fso.GetFile(strWizTempFile);
|
||||||
if (fso.FileExists(strWizTempFile))
|
tmpFile.Delete();
|
||||||
{
|
}
|
||||||
var tmpFile = fso.GetFile(strWizTempFile);
|
}
|
||||||
tmpFile.Delete();
|
catch (e) {
|
||||||
}
|
throw e;
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function CreateCustomInfFile()
|
function CreateCustomInfFile() {
|
||||||
{
|
try {
|
||||||
try
|
var fso, TemplatesFolder, TemplateFiles, strTemplate;
|
||||||
{
|
fso = new ActiveXObject('Scripting.FileSystemObject');
|
||||||
var fso, TemplatesFolder, TemplateFiles, strTemplate;
|
|
||||||
fso = new ActiveXObject('Scripting.FileSystemObject');
|
|
||||||
|
|
||||||
var TemporaryFolder = 2;
|
var TemporaryFolder = 2;
|
||||||
var tfolder = fso.GetSpecialFolder(TemporaryFolder);
|
var tfolder = fso.GetSpecialFolder(TemporaryFolder);
|
||||||
|
|
||||||
var strWizTempFile = tfolder.Path + "\\" + fso.GetTempName();
|
var strWizTempFile = tfolder.Path + "\\" + fso.GetTempName();
|
||||||
|
|
||||||
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
|
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
|
||||||
var strInfFile = strTemplatePath + '\\Templates.inf';
|
var strInfFile = strTemplatePath + '\\Templates.inf';
|
||||||
wizard.RenderTemplate(strInfFile, strWizTempFile);
|
wizard.RenderTemplate(strInfFile, strWizTempFile);
|
||||||
|
|
||||||
var WizTempFile = fso.GetFile(strWizTempFile);
|
var WizTempFile = fso.GetFile(strWizTempFile);
|
||||||
|
|
||||||
return WizTempFile;
|
return WizTempFile;
|
||||||
}
|
}
|
||||||
catch(e)
|
catch (e) {
|
||||||
{
|
throw e;
|
||||||
throw e;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetTargetName(strName, strProjectName)
|
function GetTargetName(strName, strProjectName) {
|
||||||
{
|
try {
|
||||||
try
|
var strTarget = strName;
|
||||||
{
|
|
||||||
var strTarget = strName;
|
|
||||||
|
|
||||||
var nIndex = strName.indexOf("root");
|
var nIndex = strName.indexOf("root");
|
||||||
|
|
||||||
if (nIndex >= 0)
|
if (nIndex >= 0) {
|
||||||
{
|
strTarget = strName.substring(0, nIndex) + strProjectName + strName.substring(nIndex + 4, strName.length);
|
||||||
strTarget = strName.substring(0, nIndex) + strProjectName + strName.substring(nIndex + 4, strName.length);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return strTarget;
|
return strTarget;
|
||||||
}
|
}
|
||||||
catch(e)
|
catch (e) {
|
||||||
{
|
throw e;
|
||||||
throw e;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile)
|
function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) {
|
||||||
{
|
try {
|
||||||
try
|
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
|
||||||
{
|
|
||||||
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
|
|
||||||
|
|
||||||
var strTpl = '';
|
var strTpl = '';
|
||||||
var strName = '';
|
var strName = '';
|
||||||
|
|
||||||
var strTextStream = InfFile.OpenAsTextStream(1, -2);
|
var strTextStream = InfFile.OpenAsTextStream(1, -2);
|
||||||
while (!strTextStream.AtEndOfStream)
|
while (!strTextStream.AtEndOfStream) {
|
||||||
{
|
strTpl = strTextStream.ReadLine();
|
||||||
strTpl = strTextStream.ReadLine();
|
if (strTpl != '') {
|
||||||
if (strTpl != '')
|
strName = strTpl;
|
||||||
{
|
var strTarget = GetTargetName(strName, strProjectName);
|
||||||
strName = strTpl;
|
var strTemplate = strTemplatePath + '\\' + strTpl;
|
||||||
var strTarget = GetTargetName(strName, strProjectName);
|
var strFile = strProjectPath + '\\' + strTarget;
|
||||||
var strTemplate = strTemplatePath + '\\' + strTpl;
|
|
||||||
var strFile = strProjectPath + '\\' + strTarget;
|
|
||||||
|
|
||||||
var bCopyOnly = false; //"true" will only copy the file from strTemplate to strTarget without rendering/adding to the project
|
var bCopyOnly = false; //"true" will only copy the file from strTemplate to strTarget without rendering/adding to the project
|
||||||
var strExt = strName.substr(strName.lastIndexOf("."));
|
var strExt = strName.substr(strName.lastIndexOf("."));
|
||||||
if (strExt == ".bmp" || strExt == ".ico" || strExt == ".gif" || strExt == ".rtf" || strExt == ".css")
|
if (strExt == ".bmp" || strExt == ".ico" || strExt == ".gif" || strExt == ".rtf" || strExt == ".css")
|
||||||
bCopyOnly = true;
|
bCopyOnly = true;
|
||||||
wizard.RenderTemplate(strTemplate, strFile, bCopyOnly);
|
wizard.RenderTemplate(strTemplate, strFile, bCopyOnly);
|
||||||
|
|
||||||
// don't add these files to the project
|
// don't add these files to the project
|
||||||
if(strTarget == strProjectName + ".h" ||
|
if (strTarget == strProjectName + ".h" ||
|
||||||
strTarget == strProjectName + "ps.mk" ||
|
strTarget == strProjectName + "ps.mk" ||
|
||||||
strTarget == strProjectName + "ps.def")
|
strTarget == strProjectName + "ps.def")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
proj.Object.AddFile(strFile);
|
proj.Object.AddFile(strFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strTextStream.Close();
|
strTextStream.Close();
|
||||||
}
|
}
|
||||||
catch(e)
|
catch (e) {
|
||||||
{
|
throw e;
|
||||||
throw e;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue