8 Commits

Author SHA1 Message Date
Ray
f60333d9b2 Update update_examples.yml 2025-08-23 22:19:51 +02:00
Ray
785965fcef Update update_examples.yml 2025-08-23 22:18:17 +02:00
Ray
d0e6f60ef3 Update update_examples.yml 2025-08-23 22:13:18 +02:00
Ray
6c4f220e89 Update update_examples.yml 2025-08-23 22:07:39 +02:00
Ray
c95630b7d0 Update update_examples.yml 2025-08-23 22:00:06 +02:00
Ray
e9f655d002 Update update_examples.yml 2025-08-23 21:54:09 +02:00
Ray
41211b0c8c Update update_examples.yml 2025-08-23 21:45:50 +02:00
Ray
d320a029c8 REXM: Reviewed building, using default examples Makefile/Makefile.Web 2025-08-23 21:44:28 +02:00
2 changed files with 31 additions and 28 deletions

View File

@ -39,16 +39,18 @@ jobs:
run: |
cd tools/rexm/VS2022
msbuild.exe rexm.sln /target:rexm /property:Configuration=Release /property:Platform=x64
cd ../../..
set REXM_EXAMPLES_BASE_PATH="examples"
set REXM_EXAMPLES_WEB_PATH="../raylib.com/examples"
set REXM_EXAMPLES_TEMPLATE_FILE_PATH="examples/examples_template.c"
set REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH="examples/examples_template.png"
set REXM_EXAMPLES_COLLECTION_FILE_PATH="examples/examples_list.txt"
set REXM_EXAMPLES_VS2022_SLN_FILE="projects/VS2022/raylib.sln"
set EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main"
.\tools\rexm\VS2022\build\rexm\bin\x64\Release\rexm.exe update
cd ../..
cd ${{ github.workspace }}\tools\rexm\VS2022\build\rexm\bin\x64\Release
set REXM_EXAMPLES_BASE_PATH=${{ github.workspace }}\examples
set REXM_EXAMPLES_WEB_PATH=${{ github.workspace }}\..\raylib.com\examples
set REXM_EXAMPLES_TEMPLATE_FILE_PATH=${{ github.workspace }}\examples\examples_template.c
set REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH=${{ github.workspace }}\examples\examples_template.png
set REXM_EXAMPLES_COLLECTION_FILE_PATH=${{ github.workspace }}\examples\examples_list.txt
set REXM_EXAMPLES_VS2022_SLN_FILE=${{ github.workspace }}\projects\VS2022\raylib.sln
set EMSDK_PATH=${{ github.workspace }}/emsdk-cache/emsdk-main
dir
rexm.exe build core_basic_window
cd ${{ github.workspace }}\..
dir
shell: cmd
- name: Commit changes to raylib repo

View File

@ -575,8 +575,9 @@ int main(int argc, char *argv[])
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exCategory, exName));
// Update generated .html metadata
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
char exHtmlPath[512] = { 0 };
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
// Copy results to web side
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
@ -657,8 +658,9 @@ int main(int argc, char *argv[])
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exRecategory, exRename));
// Update generated .html metadata
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
char exHtmlPath[512] = { 0 };
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
// Copy results to web side
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exRecategory, exRename),
@ -1021,8 +1023,9 @@ int main(int argc, char *argv[])
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
// Update generated .html metadata
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
char exHtmlPath[512] = { 0 };
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
// Copy results to web side
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exInfo->category, exInfo->name),
@ -1192,20 +1195,20 @@ int main(int argc, char *argv[])
if (strcmp(exCategory, "others") != 0) // Skipping "others" category
{
// Build example for PLATFORM_DESKTOP
putenv("RAYLIB_DIR=C:\\GitHub\\raylib");
putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
putenv("MAKE=mingw32-make");
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
//putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
//putenv("MAKE=mingw32-make");
ChangeDirectory(exBasePath);
system(TextFormat("%s %s/%s PLATFORM=PLATFORM_DESKTOP -B", getenv("MAKE"), exCategory, exName));
system(TextFormat("make %s/%s PLATFORM=PLATFORM_DESKTOP -B", exCategory, exName));
// Build example for PLATFORM_WEB
system(TextFormat("%s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", getenv("MAKE"), exCategory, exName));
system(TextFormat("make -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exCategory, exName));
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
// Update generated .html metadata
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
char exHtmlPath[512] = { 0 };
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
// Copy results to web side
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
@ -2171,7 +2174,6 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
char *exText = NULL; // Example code file, required to get description
char **lines = NULL; // Pointers to example code lines
int lineCount = 0; // Example code line count
int lineLength = 0; // Description line length
char exName[64] = { 0 }; // Example name: fileName without extension
char exCategory[16] = { 0 }; // Example category: core, shapes, text, textures, models, audio, shaders
@ -2182,7 +2184,6 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
memset(exTitle, 0, 64);
memset(exDescription, 0, 256);
memset(exCategory, 0, 16);
lineLength = 0;
// Get example name: replace underscore by spaces
strcpy(exName, GetFileNameWithoutExt(exHtmlPath));
@ -2195,8 +2196,9 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
// Get example description: copy line #3 from example file
exText = LoadFileText(exFilePath);
lines = LoadTextLines(exText, &lineCount);
for (int i = 0; (lines[2][i] != '\n') && (lines[2][i] != '\r'); i++) lineLength++;
int lineLength = (int)strlen(lines[2]);
strncpy(exDescription, lines[2] + 4, lineLength - 4);
UnloadTextLines(lines);
UnloadFileText(exText);
// Update example.html required text
@ -2220,7 +2222,6 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
for (int i = 0; i < 6; i++) { MemFree(fileTextUpdated[i]); fileTextUpdated[i] = NULL; }
UnloadTextLines(lines);
UnloadFileText(fileText);
}
}