Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Different Source and Compiled directories  (Read 13730 times)
.
Posts: 2


« on: December 31, 2008, 02:36:18 pm »

Hi,

Can anyone tell me how to configure Studio (2.10.02) so that i can store my source code files in one directory and the compiled code into a different directory please?

I've tried creating a local environment variable set for my config and added the $FGLSOURCEPATH and $(TargetDir) values to be the directories I want but they seem to be ignored.

I'm sure it's something simple I'm missing but I just can't figure it out.

I've also changed the 'target directory' on the project properties but that just puts both source and compiled in the same dir.

The reason I ask is because I want to be able to sync a whole dir to my source code control without the compiled software.

thanks,

Graham
Reuben B.
Four Js
Posts: 1116


« Reply #1 on: January 05, 2009, 10:52:10 pm »

Graeme,

Quote
I'm sure it's something simple I'm missing but I just can't figure it out.

have you had a look at 'Build Rules', found at  Tools->Preferences->Build Rules, and right-click in Project Manager and right-click and select Edit Build Rules.

That tells you what commands are executed when you build file(s) with certain extension.  The default installation of Studio should go close to what you want e.g.

$(fglcomp) $(FglCompilerFlags) "$(InputPath)"
$(move) "$(InputDir)/$(InputBaseName).42m" "$(TargetDir)/$(InputBaseName).42m"

$(InputDir) would be the directory of your source
$(TargetDir) would be the directory for your compiled code.

I do wonder if the text configuration files (4ad, 4tb, 4tm, 4st) should have entries to copy these files to the target directory as well e.g. create a build rule for .4ad etc that is ...

$(copy) "$(InputDir)/$(InputBaseName).4ad" "$(TargetDir)/$(InputBaseName).4ad"



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Romain W.
Four Js
Posts: 48


« Reply #2 on: January 06, 2009, 04:21:32 pm »

Hi Graeme (and Reuben),

Defining the place where compiled modules should be stored is normally done by setting property 'Target Directory' on the project nodes. You can set it once on a project root node and it will be automatically inherited on all sub-nodes. But make sure to always set it in a relative way (using value '$(WorkspaceDir)' in order to keep the portability of the project).

Otherwise, you can for sure also make global changes on the build rules of the appropriate file types (by changing the directory where binaries should be moved). But be aware that you still have to set relative paths (using '$(TargetDir)'). Also, if you change the build rules in a global way in the 'Preferences', the changes are done for all further projects.

Kind regards,
Romain W.
.
Posts: 2


« Reply #3 on: January 06, 2009, 06:01:12 pm »

Thanks for the replies guys!

Just so I am doing it correctly, can I confirm the syntax...

On the project node, I right-click and choose advanced properites.
Then choose environment variables, click the plus (+) symbol and add the following

Type = Directory
Name = $(TargetDir)
Value = C:\workspace

I just want to be sure I have the correct syntax for the environment variable name above (that it includes the $ and brackets)

Thanks,

graham
Reuben B.
Four Js
Posts: 1116


« Reply #4 on: January 08, 2009, 12:28:03 am »

Hi Graham,

In Project Manager, click on the project node or an application node, in your Properties Window you should see an entry for Target Directory.  (If you don't have a properties window, go Windows->Views and enable it). 

https://4js.com/online_documentation/fjs-gst-2.10.02-manual-html/projectmgr/User/projectmanager.html#Properties

This is the value for the target directory that you should be editing, (delete what you added in environment variable in case it gets in the way)

This creates a pre-defined node variable that can be used in build rules or environment variables as $(TargetDir). 

https://4js.com/online_documentation/fjs-gst-2.10.02-manual-html/projectmgr/User/buildrules.html#Node_Variables

Hope that helps,

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines