Difference between revisions of "Alternative file layout"

From MSX Game Library

 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
βˆ’
By default, projects using MSXgl are placed inside the library tree in the /projects/ directory. This allows all projects to share the same library and common options (in /projects/default_config.js).
+
By default, projects using {{MSXGL}} are placed inside the library tree in the <tt>projects</tt> directory.
 +
This allows all projects to share the same library source and data, and common build options (in <tt>/projects/default_config.js</tt>).
  
 
Default layout:
 
Default layout:
Line 6: Line 7:
 
  β”œβ”€πŸ“ projects
 
  β”œβ”€πŸ“ projects
 
  β”‚ β””β”€πŸ“ '''MyProject'''
 
  β”‚ β””β”€πŸ“ '''MyProject'''
 +
β”‚  β”œβ”€πŸ—Ž build.bat|sh
 +
β”‚  β”œβ”€πŸ—Ž main.c
 +
β”‚  β”œβ”€πŸ—Ž msxgl_config.h
 +
β”‚  β””β”€πŸ—Ž project_config.js
 
  β””β”€πŸ“ tools
 
  β””β”€πŸ“ tools
  
βˆ’
Having said that, some might prefer the opposite: to have one directory per project and the MSXgl directory inside.
+
Having said that, some users might prefer the opposite: to have one directory per project and the MSXgl directory inside (which is more classic and doesn't generate duplication if you only have one MSXgl project).
 +
 
 +
Alternative layout:
 +
πŸ“ '''MyProject'''
 +
β”œβ”€πŸ—Ž build.bat|sh
 +
β”œβ”€πŸ—Ž main.c
 +
β”œβ”€πŸ—Ž msxgl_config.h
 +
β”œβ”€πŸ—Ž project_config.js
 +
β””β”€πŸ“ MSXgl
 +
  β”œβ”€πŸ“ engine
 +
  β”œβ”€πŸ“ projects
 +
  β””β”€πŸ“ tools
 +
 
 +
Here are the steps to follow:
 +
* Create your <tt>MyProject</tt> directory wherever you want.
 +
* [[Install|Install MSXgl]] in it (in <tt>MyProject/MSXgl</tt> for example).
 +
* Create your source files in the <tt>MyProject</tt> directory. For example, copy all the files from the <tt>MSXgl/projects/template</tt> directory to the root of your project.
 +
* Modify the <tt>build.bat</tt> (Windows) or <tt>build.sh</tt> (Linux/macOS) to indicate the path to Node.js (in <tt>MSXgl/tools/build/Node</tt>) and to the build script (<tt>MSXgl/engine/script/js</tt>).
 +
* You are done! You can now build your project from the root of your directory.
 +
 
 +
For example, if you use the files from the template project on Windows, you have to make those changes in the <tt>build.bat</tt> file:
 +
 
 +
..\..\tools\build\Node\node.exe ..\..\engine\script\js\build.js target=%1
 +
 
 +
to:
 +
 
 +
MSXgl\tools\build\Node\node.exe MSXgl\engine\script\js\build.js target=%1

Latest revision as of 00:13, 5 November 2023

By default, projects using MSXGL are placed inside the library tree in the projects directory. This allows all projects to share the same library source and data, and common build options (in /projects/default_config.js).

Default layout:

πŸ“ MSXgl
β”œβ”€πŸ“ engine
β”œβ”€πŸ“ projects
β”‚ β””β”€πŸ“ MyProject
β”‚   β”œβ”€πŸ—Ž build.bat|sh
β”‚   β”œβ”€πŸ—Ž main.c
β”‚   β”œβ”€πŸ—Ž msxgl_config.h
β”‚   β””β”€πŸ—Ž project_config.js
β””β”€πŸ“ tools

Having said that, some users might prefer the opposite: to have one directory per project and the MSXgl directory inside (which is more classic and doesn't generate duplication if you only have one MSXgl project).

Alternative layout:

πŸ“ MyProject
β”œβ”€πŸ—Ž build.bat|sh
β”œβ”€πŸ—Ž main.c
β”œβ”€πŸ—Ž msxgl_config.h
β”œβ”€πŸ—Ž project_config.js
β””β”€πŸ“ MSXgl
  β”œβ”€πŸ“ engine
  β”œβ”€πŸ“ projects
  β””β”€πŸ“ tools

Here are the steps to follow:

  • Create your MyProject directory wherever you want.
  • Install MSXgl in it (in MyProject/MSXgl for example).
  • Create your source files in the MyProject directory. For example, copy all the files from the MSXgl/projects/template directory to the root of your project.
  • Modify the build.bat (Windows) or build.sh (Linux/macOS) to indicate the path to Node.js (in MSXgl/tools/build/Node) and to the build script (MSXgl/engine/script/js).
  • You are done! You can now build your project from the root of your directory.

For example, if you use the files from the template project on Windows, you have to make those changes in the build.bat file:

..\..\tools\build\Node\node.exe ..\..\engine\script\js\build.js target=%1

to:

MSXgl\tools\build\Node\node.exe MSXgl\engine\script\js\build.js target=%1