Просмотр исходного кода

Added compile scripts option to IDE export project window.

Christopher Reed 12 лет назад
Родитель
Сommit
b11196824e

+ 2 - 1
IDE/Contents/Include/ExportProjectWindow.h

@@ -47,5 +47,6 @@ class ExportProjectWindow : public UIWindow {
 		
 		UICheckBox *macCheckBox;
 		UICheckBox *winCheckBox;
-		UICheckBox *linCheckBox;		
+		UICheckBox *linCheckBox;
+		UICheckBox *compileCheckBox;
 };

+ 1 - 1
IDE/Contents/Include/PolycodeProjectManager.h

@@ -48,7 +48,7 @@ class PolycodeProjectManager : public EventDispatcher {
 	
 	PolycodeProject *getProjectByProjectFile(String projectFile);
 	
-	void exportProject(PolycodeProject *project, String exportPath, bool macOS, bool windows, bool linux_);
+	void exportProject(PolycodeProject *project, String exportPath, bool macOS, bool windows, bool linux_, bool compileScripts);
 	
 	int removeProject(PolycodeProject *project);
 	

+ 1 - 1
IDE/Contents/Include/PolycodeToolLauncher.h

@@ -52,7 +52,7 @@ class PolycodeToolLauncher {
 		
 		static void openExternalEditor(String app, String file, String inFolder);
 		static String generateTempPath(PolycodeProject *project);
-		static void buildProject(PolycodeProject *project, String destinationPath);
+		static void buildProject(PolycodeProject *project, String destinationPath, bool compileScripts);
 
 		static void runPolyapp(String polyappPath);
 };

+ 11 - 3
IDE/Contents/Source/ExportProjectWindow.cpp

@@ -25,7 +25,7 @@
 
 extern PolycodeFrame *globalFrame;
 
-ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 300) {
+ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 360) {
 
 	closeOnEscape = true;
 
@@ -62,17 +62,25 @@ ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 3
 	addChild(linCheckBox);
 	linCheckBox->setPosition(padding, 225);
 
+	label = new ScreenLabel("OPTIONS", 22, "section", Label::ANTIALIAS_FULL);
+	addChild(label);
+	label->color.a = 0.4;	
+	label->setPosition(padding, 260);
+
+	compileCheckBox = new UICheckBox("Compile Scripts (experimental)", false);
+	addChild(compileCheckBox);
+	compileCheckBox->setPosition(padding, 295);
 
 	cancelButton = new UIButton(L"Cancel", 100);
 	cancelButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	addChild(cancelButton);
-	cancelButton->setPosition(400-75-padding-100-10, 300-15);
+	cancelButton->setPosition(400-75-padding-100-10, 360-15);
 		
 	
 	okButton = new UIButton(L"Publish", 100);
 	okButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	addChild(okButton);
-	okButton->setPosition(400-75-padding, 300-15);
+	okButton->setPosition(400-75-padding, 360-15);
 	
 	projectLocationInput->setText(CoreServices::getInstance()->getCore()->getUserHomeDirectory()+"/Documents/Polycode");
 	

+ 2 - 2
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -405,7 +405,7 @@ void PolycodeIDEApp::doRunProject() {
 	frame->showConsole();
 
 	String outPath = PolycodeToolLauncher::generateTempPath(projectManager->getActiveProject()) + ".polyapp";
-	PolycodeToolLauncher::buildProject(projectManager->getActiveProject(), outPath);
+	PolycodeToolLauncher::buildProject(projectManager->getActiveProject(), outPath, false);
 	PolycodeToolLauncher::runPolyapp(outPath);
 }
 
@@ -899,7 +899,7 @@ void PolycodeIDEApp::handleEvent(Event *event) {
 
 	if(event->getDispatcher() == frame->exportProjectWindow) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
-			projectManager->exportProject(projectManager->getActiveProject(), frame->exportProjectWindow->projectLocationInput->getText(), frame->exportProjectWindow->macCheckBox->isChecked(), frame->exportProjectWindow->winCheckBox->isChecked(), frame->exportProjectWindow->linCheckBox->isChecked());
+			projectManager->exportProject(projectManager->getActiveProject(), frame->exportProjectWindow->projectLocationInput->getText(), frame->exportProjectWindow->macCheckBox->isChecked(), frame->exportProjectWindow->winCheckBox->isChecked(), frame->exportProjectWindow->linCheckBox->isChecked(), frame->exportProjectWindow->compileCheckBox->isChecked());
 			frame->hideModal();			
 		}
 	}

+ 2 - 2
IDE/Contents/Source/PolycodeProjectManager.cpp

@@ -137,14 +137,14 @@ void PolycodeProjectManager::createNewProject(String templateFolder, String proj
 	openProject(projectLocation+"/"+projectName+"/"+projectName+".polyproject");	
 }
 
-void PolycodeProjectManager::exportProject(PolycodeProject *project, String exportPath, bool macOS, bool windows, bool linux_) {
+void PolycodeProjectManager::exportProject(PolycodeProject *project, String exportPath, bool macOS, bool windows, bool linux_, bool compileScripts) {
 
 	String polycodeBasePath = CoreServices::getInstance()->getCore()->getDefaultWorkingDirectory();
 
 	String publishPath = polycodeBasePath+"/Standalone/Publish";
 	
 	String polyappPath = PolycodeToolLauncher::generateTempPath(project) + ".polyapp";
-	PolycodeToolLauncher::buildProject(project, polyappPath);	
+	PolycodeToolLauncher::buildProject(project, polyappPath, compileScripts);	
 	
 	if(macOS) {
 		PolycodeConsole::print("Exporting Mac version to "+exportPath+"/Mac \n");

+ 3 - 3
IDE/Contents/Source/PolycodeToolLauncher.cpp

@@ -86,7 +86,7 @@ String PolycodeToolLauncher::generateTempPath(PolycodeProject *project) {
 #endif
 }
 
-void PolycodeToolLauncher::buildProject(PolycodeProject *project, String destinationPath) {
+void PolycodeToolLauncher::buildProject(PolycodeProject *project, String destinationPath, bool compileScripts) {
 
 	PolycodeConsole::print("Building project: "+project->getProjectName() + "\n");	
 
@@ -101,12 +101,12 @@ void PolycodeToolLauncher::buildProject(PolycodeProject *project, String destina
 #ifdef _WINDOWS
 	String targetFolder = projectBasePath;
 	String command = "\""+polycodeBasePath+"/Standalone/Bin/polybuild.exe\"";
-	String args =  "--config=\""+projectPath+"\" --out=\""+destinationPath+"\"";
+	String args =  "--config=\""+projectPath+"\" --out=\""+destinationPath+"\" --compileScripts=\""+((compileScripts)?"true":"false")+"\"";
 	String ret = CoreServices::getInstance()->getCore()->executeExternalCommand(command, args, targetFolder);
 #else
 	String command = polycodeBasePath+"/Standalone/Bin/polybuild";
 	String inFolder = projectBasePath; 
-	String args = "--config=\""+projectPath+"\" --out="+destinationPath;
+	String args = "--config=\""+projectPath+"\" --out=\""+destinationPath+"\" --compileScripts=\""+((compileScripts)?"true":"false")+"\"";
 	String ret = CoreServices::getInstance()->getCore()->executeExternalCommand(command, args, inFolder);
 //	PolycodeConsole::print(ret);
 #endif