2011-03-09 15:35:06 +08:00
|
|
|
function LogInfo(strInfo) {
|
|
|
|
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
|
|
|
|
var strLogPath = "\\CCApplicationWizardLog.txt"
|
|
|
|
var file = FileSys.OpenTextFile(strLogPath, 8, true);
|
|
|
|
file.WriteLine(strInfo);
|
|
|
|
file.Close();
|
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function OnFinish(selProj, selObj) {
|
|
|
|
try {
|
2011-03-09 15:35:06 +08:00
|
|
|
// Create symbols based on the project name
|
2010-11-26 17:30:34 +08:00
|
|
|
var strProjectPath = wizard.FindSymbol('PROJECT_PATH');
|
|
|
|
var strProjectName = wizard.FindSymbol('PROJECT_NAME');
|
|
|
|
|
2011-01-18 11:45:22 +08:00
|
|
|
// var WizardVersion = wizard.FindSymbol('WIZARD_VERSION');
|
|
|
|
// if(WizardVersion >= 8.0)
|
|
|
|
// {
|
|
|
|
// }
|
2010-11-26 17:30:34 +08:00
|
|
|
|
|
|
|
// Create symbols based on the project name
|
|
|
|
var strSafeProjectName = CreateSafeName(strProjectName);
|
|
|
|
wizard.AddSymbol("SAFE_PROJECT_NAME", strSafeProjectName);
|
|
|
|
wizard.AddSymbol("NICE_SAFE_PROJECT_NAME", strSafeProjectName.substr(0, 1).toUpperCase() + strSafeProjectName.substr(1))
|
|
|
|
wizard.AddSymbol("UPPERCASE_SAFE_PROJECT_NAME", strSafeProjectName.toUpperCase());
|
|
|
|
|
|
|
|
// Set current year symbol
|
|
|
|
var d = new Date();
|
|
|
|
var nYear = 0;
|
|
|
|
nYear = d.getFullYear();
|
2011-03-09 15:35:06 +08:00
|
|
|
wizard.AddSymbol("CC_CURRENT_YEAR", nYear);
|
|
|
|
wizard.AddSymbol("CC_CURRENT_DATE", d.toString());
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function CreateCustomProject(strProjectName, strProjectPath) {
|
|
|
|
try {
|
|
|
|
var strProjTemplatePath = wizard.FindSymbol('PROJECT_TEMPLATE_PATH');
|
|
|
|
var strProjTemplate = '';
|
2011-03-09 15:35:06 +08:00
|
|
|
var WizardVersion = wizard.FindSymbol('WIZARD_VERSION');
|
|
|
|
if(WizardVersion >= 10.0)
|
|
|
|
strProjTemplate = strProjTemplatePath + '\\default.vcxproj';
|
|
|
|
else
|
|
|
|
strProjTemplate = strProjTemplatePath + '\\default.vcproj';
|
2010-11-26 17:30:34 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
// Create vcproj.user file
|
|
|
|
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
|
2011-03-09 15:35:06 +08:00
|
|
|
var strUserTarget = "";
|
|
|
|
if(WizardVersion >= 10.0)
|
|
|
|
strUserTarget = strProjectName + ".win32.vcxproj.user";
|
|
|
|
else
|
|
|
|
strUserTarget = strProjectName + ".win32.vcproj.user";
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
var strUserPath = FileSys.BuildPath(strProjectPath, strUserTarget);
|
2011-03-09 15:35:06 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
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);
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
2010-11-26 17:30:34 +08:00
|
|
|
|
|
|
|
var file = FileSys.OpenTextFile(strUserPath, 2, true);
|
2011-03-09 15:35:06 +08:00
|
|
|
var strUserValue = "";
|
|
|
|
if(WizardVersion >= 10.0)
|
|
|
|
strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n <PropertyGroup>\r\n <ShowAllFiles>true</ShowAllFiles>\r\n </PropertyGroup>\r\n</Project>";
|
|
|
|
else
|
|
|
|
strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?><VisualStudioUserFile ProjectType=\"Visual C++\" Version=\"9.00\" ShowAllFiles=\"true\"></VisualStudioUserFile>";
|
2010-11-16 11:25:33 +08:00
|
|
|
file.WriteLine(strUserValue);
|
2011-03-09 15:35:06 +08:00
|
|
|
file.Close();
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2011-03-09 15:35:06 +08:00
|
|
|
// Create project file
|
2010-11-26 17:30:34 +08:00
|
|
|
var strProjectNameWithExt = '';
|
2011-03-09 15:35:06 +08:00
|
|
|
if(WizardVersion >= 10.0)
|
|
|
|
strProjectNameWithExt = strProjectName + '.win32.vcxproj';
|
|
|
|
else
|
|
|
|
strProjectNameWithExt = strProjectName + '.win32.vcproj';
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
var oTarget = wizard.FindSymbol("TARGET");
|
|
|
|
var prj;
|
|
|
|
if (wizard.FindSymbol("WIZARD_TYPE") == vsWizardAddSubProject) // vsWizardAddSubProject
|
|
|
|
{
|
|
|
|
var prjItem = oTarget.AddFromTemplate(strProjTemplate, strProjectNameWithExt);
|
|
|
|
prj = prjItem.SubProject;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
prj = oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt);
|
|
|
|
}
|
|
|
|
return prj;
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
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;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Configurations data
|
|
|
|
var nNumConfigs = 2;
|
|
|
|
|
|
|
|
var astrConfigName = new Array();
|
|
|
|
astrConfigName[0] = "Debug";
|
|
|
|
astrConfigName[1] = "Release";
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function AddConfigurations(proj, strProjectName) {
|
|
|
|
try {
|
|
|
|
var nCntr;
|
|
|
|
for (nCntr = 0; nCntr < nNumConfigs; nCntr++) {
|
|
|
|
// Check if it's Debug configuration
|
|
|
|
var bDebug = false;
|
|
|
|
if (astrConfigName[nCntr].search("Debug") != -1)
|
|
|
|
bDebug = true;
|
|
|
|
|
|
|
|
// General settings
|
|
|
|
var config = proj.Object.Configurations(astrConfigName[nCntr]);
|
|
|
|
|
2011-03-09 15:35:06 +08:00
|
|
|
// if(wizard.FindSymbol("CC_USE_UNICODE"))
|
2010-11-26 17:30:34 +08:00
|
|
|
config.CharacterSet = charSetUnicode;
|
2011-01-18 11:45:22 +08:00
|
|
|
// else
|
|
|
|
// config.CharacterSet = charSetMBCS;
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2011-03-17 10:03:32 +08:00
|
|
|
var WizardVersion = wizard.FindSymbol('WIZARD_VERSION');
|
|
|
|
if(WizardVersion >= 10.0) {
|
2011-04-07 14:37:19 +08:00
|
|
|
config.OutputDirectory = '$(SolutionDir)$(Configuration).win32\\'
|
|
|
|
config.IntermediateDirectory = '$(Configuration).win32\\';
|
2011-03-17 10:03:32 +08:00
|
|
|
} else {
|
|
|
|
config.OutputDirectory = '$(SolutionDir)$(ConfigurationName).win32'
|
|
|
|
config.IntermediateDirectory = '$(ConfigurationName).win32';
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
// Compiler settings
|
|
|
|
var CLTool = config.Tools('VCCLCompilerTool');
|
2010-11-16 11:25:33 +08:00
|
|
|
|
|
|
|
// Additional Inlcude Directories
|
2011-01-19 15:29:08 +08:00
|
|
|
var strAddIncludeDir = '.;.\\win32;.\\Classes';
|
2011-03-10 12:00:29 +08:00
|
|
|
strAddIncludeDir += ';..\\cocos2dx;..\\cocos2dx\\include';
|
2011-03-09 15:35:06 +08:00
|
|
|
strAddIncludeDir += ';..\\cocos2dx\\platform';
|
|
|
|
strAddIncludeDir += ';..\\cocos2dx\\platform\\third_party\\win32\\OGLES';
|
2011-01-19 15:29:08 +08:00
|
|
|
|
2011-03-09 15:35:06 +08:00
|
|
|
if (wizard.FindSymbol('CC_USE_BOX2D')) {
|
2010-11-26 17:30:34 +08:00
|
|
|
strAddIncludeDir += ';..\\;..\\Box2D';
|
|
|
|
}
|
2011-03-09 15:35:06 +08:00
|
|
|
if (wizard.FindSymbol('CC_USE_CHIPMUNK')) {
|
2010-11-26 17:30:34 +08:00
|
|
|
strAddIncludeDir += ';..\\chipmunk\\include\\chipmunk';
|
|
|
|
}
|
2011-03-09 15:35:06 +08:00
|
|
|
if (wizard.FindSymbol('CC_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE')) {
|
2010-11-26 17:30:34 +08:00
|
|
|
strAddIncludeDir += ';..\\CocosDenshion\\Include';
|
|
|
|
}
|
|
|
|
CLTool.AdditionalIncludeDirectories = strAddIncludeDir;
|
|
|
|
|
|
|
|
CLTool.UsePrecompiledHeader = pchNone; // pchUseUsingSpecific;
|
|
|
|
CLTool.WarningLevel = warningLevel_3;
|
|
|
|
if (bDebug) {
|
|
|
|
CLTool.RuntimeLibrary = rtMultiThreadedDebug;
|
|
|
|
CLTool.MinimalRebuild = true;
|
|
|
|
CLTool.DebugInformationFormat = debugEditAndContinue;
|
|
|
|
CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
|
|
|
|
CLTool.Optimization = optimizeDisabled;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
CLTool.RuntimeLibrary = rtMultiThreaded;
|
|
|
|
CLTool.ExceptionHandling = false;
|
|
|
|
CLTool.DebugInformationFormat = debugDisabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
var strDefines = GetPlatformDefine(config);
|
|
|
|
strDefines += "_WINDOWS;STRICT;";
|
|
|
|
if (bDebug)
|
2011-01-27 15:01:38 +08:00
|
|
|
strDefines += "_DEBUG;COCOS2D_DEBUG=1;";
|
2010-11-26 17:30:34 +08:00
|
|
|
else
|
|
|
|
strDefines += "NDEBUG";
|
|
|
|
CLTool.PreprocessorDefinitions = strDefines;
|
|
|
|
|
|
|
|
// Disable special warning
|
|
|
|
CLTool.DisableSpecificWarnings = "4251";
|
|
|
|
|
|
|
|
// Linker settings
|
|
|
|
var LinkTool = config.Tools('VCLinkerTool');
|
|
|
|
LinkTool.SubSystem = subSystemWindows;
|
|
|
|
LinkTool.TargetMachine = machineX86;
|
|
|
|
if (bDebug) {
|
|
|
|
LinkTool.LinkIncremental = linkIncrementalYes;
|
|
|
|
LinkTool.GenerateDebugInformation = true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
LinkTool.LinkIncremental = linkIncrementalNo;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
|
|
|
|
// Additional Library Directories
|
|
|
|
var strAddDepends = 'libcocos2d.lib libgles_cm.lib';
|
2011-03-09 15:35:06 +08:00
|
|
|
if (wizard.FindSymbol('CC_USE_BOX2D')) {
|
2010-11-16 11:25:33 +08:00
|
|
|
strAddDepends += ' libBox2d.lib';
|
|
|
|
}
|
2011-03-09 15:35:06 +08:00
|
|
|
if (wizard.FindSymbol('CC_USE_CHIPMUNK')) {
|
2010-11-26 17:30:34 +08:00
|
|
|
strAddDepends += ' libchipmunk.lib';
|
|
|
|
}
|
2011-03-09 15:35:06 +08:00
|
|
|
if (wizard.FindSymbol('CC_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE')) {
|
2010-11-26 17:30:34 +08:00
|
|
|
strAddDepends += ' libCocosDenshion.lib';
|
|
|
|
}
|
|
|
|
LinkTool.AdditionalLibraryDirectories = '$(OutDir)';
|
2010-11-16 11:25:33 +08:00
|
|
|
LinkTool.AdditionalDependencies = strAddDepends;
|
2010-11-26 17:30:34 +08:00
|
|
|
|
|
|
|
// Resource settings
|
|
|
|
var RCTool = config.Tools("VCResourceCompilerTool");
|
|
|
|
RCTool.Culture = rcEnglishUS;
|
|
|
|
RCTool.AdditionalIncludeDirectories = "$(IntDir)";
|
|
|
|
if (bDebug)
|
|
|
|
RCTool.PreprocessorDefinitions = "_DEBUG";
|
|
|
|
else
|
|
|
|
RCTool.PreprocessorDefinitions = "NDEBUG";
|
|
|
|
|
|
|
|
// MIDL settings
|
|
|
|
var MidlTool = config.Tools("VCMidlTool");
|
|
|
|
MidlTool.MkTypLibCompatible = false;
|
|
|
|
if (IsPlatformWin32(config))
|
|
|
|
MidlTool.TargetEnvironment = midlTargetWin32;
|
|
|
|
if (bDebug)
|
|
|
|
MidlTool.PreprocessorDefinitions = "_DEBUG";
|
|
|
|
else
|
|
|
|
MidlTool.PreprocessorDefinitions = "NDEBUG";
|
|
|
|
MidlTool.HeaderFileName = strProjectName + ".h";
|
|
|
|
MidlTool.InterfaceIdentifierFileName = strProjectName + "_i.c";
|
|
|
|
MidlTool.ProxyFileName = strProjectName + "_p.c";
|
|
|
|
MidlTool.GenerateStublessProxies = true;
|
|
|
|
MidlTool.TypeLibraryName = "$(IntDir)/" + strProjectName + ".tlb";
|
|
|
|
MidlTool.DLLDataFileName = "";
|
|
|
|
|
|
|
|
// Post-build settings
|
2011-01-18 11:45:22 +08:00
|
|
|
var PostBuildTool = config.Tools("VCPostBuildEventTool");
|
|
|
|
PostBuildTool.Description = "Performing copy resource from Resource to OutDir...";
|
2011-03-11 11:12:41 +08:00
|
|
|
PostBuildTool.CommandLine = "xcopy /E /Q /Y \"$(ProjectDir)Resource\\*.*\" \"$(OutDir)\"";
|
2010-11-26 17:30:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function AddPchSettings(proj) {
|
|
|
|
try {
|
2011-01-18 11:45:22 +08:00
|
|
|
// var files = proj.Object.Files;
|
|
|
|
// var fStdafx = files("StdAfx.cpp");
|
2010-11-26 17:30:34 +08:00
|
|
|
//
|
2011-01-18 11:45:22 +08:00
|
|
|
// var nCntr;
|
|
|
|
// for(nCntr = 0; nCntr < nNumConfigs; nCntr++)
|
|
|
|
// {
|
|
|
|
// var config = fStdafx.FileConfigurations(astrConfigName[nCntr]);
|
|
|
|
// config.Tool.UsePrecompiledHeader = pchCreateUsingSpecific;
|
|
|
|
// }
|
2010-11-26 17:30:34 +08:00
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function DelFile(fso, strWizTempFile) {
|
|
|
|
try {
|
|
|
|
if (fso.FileExists(strWizTempFile)) {
|
|
|
|
var tmpFile = fso.GetFile(strWizTempFile);
|
|
|
|
tmpFile.Delete();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function CreateCustomInfFile() {
|
|
|
|
try {
|
|
|
|
var fso, TemplatesFolder, TemplateFiles, strTemplate;
|
|
|
|
fso = new ActiveXObject('Scripting.FileSystemObject');
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
var TemporaryFolder = 2;
|
|
|
|
var tfolder = fso.GetSpecialFolder(TemporaryFolder);
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
var strWizTempFile = tfolder.Path + "\\" + fso.GetTempName();
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
|
|
|
|
var strInfFile = strTemplatePath + '\\Templates.inf';
|
|
|
|
wizard.RenderTemplate(strInfFile, strWizTempFile);
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
var WizTempFile = fso.GetFile(strWizTempFile);
|
2010-11-16 11:25:33 +08:00
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
return WizTempFile;
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function GetTargetName(strName, strProjectName) {
|
|
|
|
try {
|
|
|
|
var strTarget = strName;
|
|
|
|
|
|
|
|
var nIndex = strName.indexOf("root");
|
|
|
|
|
|
|
|
if (nIndex >= 0) {
|
|
|
|
strTarget = strName.substring(0, nIndex) + strProjectName + strName.substring(nIndex + 4, strName.length);
|
|
|
|
}
|
|
|
|
|
|
|
|
return strTarget;
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|
|
|
|
|
2010-11-26 17:30:34 +08:00
|
|
|
function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) {
|
|
|
|
try {
|
|
|
|
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
|
|
|
|
|
|
|
|
var strTpl = '';
|
|
|
|
var strName = '';
|
|
|
|
|
|
|
|
var strTextStream = InfFile.OpenAsTextStream(1, -2);
|
|
|
|
while (!strTextStream.AtEndOfStream) {
|
|
|
|
strTpl = strTextStream.ReadLine();
|
|
|
|
if (strTpl != '') {
|
|
|
|
strName = strTpl;
|
|
|
|
var strTarget = GetTargetName(strName, strProjectName);
|
|
|
|
var strTemplate = strTemplatePath + '\\' + strTpl;
|
|
|
|
var strFile = strProjectPath + '\\' + strTarget;
|
|
|
|
|
2011-01-18 11:45:22 +08:00
|
|
|
var bCopyOnly = true; //"true" will only copy the file from strTemplate to strTarget without rendering/adding to the project
|
2010-11-26 17:30:34 +08:00
|
|
|
var strExt = strName.substr(strName.lastIndexOf("."));
|
2011-01-18 11:45:22 +08:00
|
|
|
if (strExt == ".h" || strExt == ".cpp" || strExt == ".c" || strExt == ".rc")
|
|
|
|
bCopyOnly = false;
|
2010-11-26 17:30:34 +08:00
|
|
|
wizard.RenderTemplate(strTemplate, strFile, bCopyOnly);
|
|
|
|
|
|
|
|
// don't add these files to the project
|
|
|
|
if (strTarget == strProjectName + ".h" ||
|
2011-01-18 11:45:22 +08:00
|
|
|
strTarget == strProjectName + "ps.mk" ||
|
|
|
|
strTarget == strProjectName + "ps.def")
|
2010-11-26 17:30:34 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
proj.Object.AddFile(strFile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
strTextStream.Close();
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
throw e;
|
|
|
|
}
|
2010-11-16 11:25:33 +08:00
|
|
|
}
|