Developer forums (C::B DEVELOPMENT STRICTLY!) > Compiler Framework Redesign

suggestion: add "Download" button into Compiler Framework"

<< < (4/6) > >>

dmoore:

--- Quote from: MortenMacFly on December 15, 2012, 08:58:24 am ---
--- Quote from: dmoore on December 15, 2012, 02:39:38 am ---Wasn't sure what the rationale was for commands only and whether it was a conscious decision that it should not be "runnable"

--- End quote ---
Well the issue here is: What to run? There is no executable produced or alike. So it will need some tweaking - currently C::B would report that the executable has not been built yet. Note that pre- and post-build steps actually should work. So what exactly would you "run"?

--- End quote ---

If it is an interpreted language, it would be the command to run the main module. No "build" is required but there might some deployment steps that could be put in the pure/post build commands.

MortenMacFly:

--- Quote from: dmoore on December 15, 2012, 03:27:15 pm ---If it is an interpreted language, it would be the command to run the main module. No "build" is required but there might some deployment steps that could be put in the pure/post build commands.

--- End quote ---
And what would be the difference to a pre-/ post-build step in the commands only target? (Sorry to maybe sound dumb - but I still don't see the advantage and seem missing the obvious...?!)

dmoore:

--- Quote from: MortenMacFly on December 16, 2012, 07:41:15 am ---
--- Quote from: dmoore on December 15, 2012, 03:27:15 pm ---If it is an interpreted language, it would be the command to run the main module. No "build" is required but there might some deployment steps that could be put in the pure/post build commands.

--- End quote ---
And what would be the difference to a pre-/ post-build step in the commands only target? (Sorry to maybe sound dumb - but I still don't see the advantage and seem missing the obvious...?!)

--- End quote ---

My idea is that interpreted (or any other non-compiled) projects be able to use the build framework like compiled projects. Seems a little odd that you would have to press build to run the project right? I can see cases where you would want to define both build and run.The build steps would only need to be run if there are changes to sources (e.g. resources might need to be repackages into zip files). The run command should run the main module. I have several small projects that could take advantage of this.

MortenMacFly:

--- Quote from: dmoore on December 16, 2012, 04:17:04 pm ---My idea is that interpreted (or any other non-compiled) projects be able to use the build framework like compiled projects.

--- End quote ---
Oh - OK. But doesn't this require even more changes? Like adopting the build framework?

Alpha:
Assuming I understand the idea being discussed, the following would be the core of the necessary changes (I think):

--- Code: ---Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 8684)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -1880,9 +1880,15 @@
     else
     {
         // commands-only target?
-        cbMessageBox(_("You can't \"run\" a commands-only target..."));
-        m_pProject->SetCurrentlyCompilingTarget(0);
-        return -1;
+        if (target->GetHostApplication().IsEmpty())
+        {
+            cbMessageBox(_("You must select a host application to \"run\" a commands-only target..."));
+            m_pProject->SetCurrentlyCompilingTarget(0);
+            return -1;
+        }
+        Manager::Get()->GetMacrosManager()->ReplaceEnvVars(hostapStr);
+        command << hostapStr << strSPACE;
+        command << target->GetExecutionParameters();
     }
 
     wxString script = command;
@@ -1903,7 +1909,7 @@
         cmd << command;
 
     Manager::Get()->GetLogManager()->Log(_("Checking for existence: ") + f.GetFullPath(), m_PageIndex);
-    if (!wxFileExists(f.GetFullPath()))
+    if ( (target->GetTargetType() != ttCommandsOnly) && !wxFileExists(f.GetFullPath()) )
     {
         int ret = cbMessageBox(_("It seems that this project has not been built yet.\n"
                                 "Do you want to build it now?"),

--- End code ---
(Note: this code was very quickly stuck together; do not commit without changing/fixing/polishing.)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version