Raised This Month: $12 Target: $400
 3% 

[Build Tool] AMXXPack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-19-2022 , 23:35   [Build Tool] AMXXPack
Reply With Quote #1


📦 AMXXPack
(https://github.com/Hedgefog/node-amxxpack)

Simple build system and CLI for AMX Mod X projects.

📄 About
This system will be useful for projects with multiple plugins and assets. Using the command-line interface you can build entire project with a single command. It also supports hot rebuild to keep your plugins and assets up to date during the work.

It's similar to Halloween Mod and Zombie Panic build systems, but it's now a single npm package that doesn't require gulp.

📚 Features
  • ⚙ Flexible configuration
  • 🔥 Hot reload
  • 🧸 Assets builder

🔄 Requirements
  • Node.js 10.0.0+

📖 Details
See more on GitHub: https://github.com/Hedgefog/node-amxxpack
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 03-04-2022 at 12:05.
Hedgehog Fog is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-19-2022 , 23:35   Re: [Build Tool] AMXXPack
Reply With Quote #2

Reserved
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 02-20-2022 , 00:07   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #3

Very interesting.
Although the explaination was a bit vague, I download amxxpack package through npm and the process went smoothly until I had to exec npm run build. It lead to this error log

0 verbose cli [
0 verbose cli '/root/.nvm/versions/node/v17.5.0/bin/node',
0 verbose cli '/root/.nvm/versions/node/v17.5.0/bin/npm',
0 verbose cli 'run',
0 verbose cli 'build'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/root/.nvm/versions/node/v17.5.0/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/root/amxxpack/.npmrc Completed in 0ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:/root/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/root/.nvm/versions/node/v17.5.0/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 11ms
19 timing npm:load:configload Completed in 11ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 4ms
23 verbose logfile /root/.npm/_logs/2022-02-20T05_03_02_614Z-debug-0.log
24 timing npm:load:logFile Completed in 4ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 19ms
28 timing command:run Completed in 3ms
29 verbose stack Error: Missing script: "build"
29 verbose stack
29 verbose stack To see a list of scripts, run:
29 verbose stack npm run
29 verbose stack at RunScript.run (/root/.nvm/versions/node/v17.5.0/lib/node_modules/npm/lib/commands/run-script.js:95:13)
29 verbose stack at async module.exports (/root/.nvm/versions/node/v17.5.0/lib/node_modules/npm/lib/cli.js:66:5)
30 verbose cwd /root/amxxpack
31 verbose Linux 4.4.0-19041-Microsoft
32 verbose argv "/root/.nvm/versions/node/v17.5.0/bin/node" "/root/.nvm/versions/node/v17.5.0/bin/npm" "run" "build"
33 verbose node v17.5.0
34 verbose npm v8.5.1
35 error Missing script: "build"
35 error
35 error To see a list of scripts, run:
35 error npm run
36 verbose exit 1
37 timing npm Completed in 165ms
38 verbose code 1
39 error A complete log of this run can be found in:
39 error /root/.npm/_logs/2022-02-20T05_03_02_614Z-debug-0.log

npx amxxpack build did show a positive message
but npm run prints this

Lifecycle scripts included in [email protected]:
test
echo "Error: no test specified" && exit 1
bigdaddy424 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-20-2022 , 05:25   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #4

Is there a purpose to this other than simply compiling multiple plugins in a single project? Can it be used in CI? Also, if it can be used in CI and you develop locally on Windows but do CI on Linux, does this handle that transition? It looks like this might require editing a config. I presume you could detect the OS and resolve that (unless it's already built in).
__________________

Last edited by fysiks; 02-20-2022 at 05:28.
fysiks is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-20-2022 , 07:40   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #5

bigdaddy424,
Quote:
error Missing script: "build"
It looks like you didn't add a build script to your project. Use:
Code:
npx amxxpack build
or add a build script like in the last quickstart step.

fysiks,
Yep, it can be used for CI, Zombie Panic is already using it: https://github.com/Hedgefog/cs-zombie-panic
It also supports javascript configs.

build script
PHP Code:
amxxpack build --config .amxxpack.js 
.amxxpac.js
PHP Code:
const path = require('path');
const 
os = require('os');

const 
compilerExecutable os.platform() === 'win32' 'amxxpc.exe' 'amxxpc';

module.exports = {
  
compiler: { 
    
executablepath.join('./compiler'compilerExecutable),
    include: [
      
'./compiler/include',
      
'./thirdparty/reapi/addons/amxmodx/scripting/include'
    
]
  },
  
input: {
    
scripts'./src/scripts',
    include: 
'./src/include',
    
assets'./assets'
  
},
  
output: {
    
plugins'./dist/addons/amxmodx/plugins',
    
scripts'./dist/addons/amxmodx/scripting',
    include: 
'./dist/addons/amxmodx/scripting/include',
    
assets'./dist'
  
},
  
rules: {
    
flatCompilationtrue
  
}

__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 02-21-2022 at 05:00.
Hedgehog Fog is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-21-2022 , 11:25   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #6

Update
  • Added fetch-compiler command to fetch compiler

Installing compiler for Amx Mod X 1.9.0 with Counter-Strike addon:
Code:
amxxpack fetch-compiler --addon cstrike --version 1.9.0-git5294 --dev
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 02-21-2022 at 11:25.
Hedgehog Fog is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-23-2022 , 13:32   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #7

Version 1.0.0 released!
⚠ Version 1.0.0 has a different configuration file structure, so please remove and reinitialize your projects.

AMXXPack has now supported compiler and third-party configuration to fetch it with the install command.

You can also use "amxxpack new" command to create a new file in the project:
Code:
amxxpack new script my_plugin --include "fakemeta,hamsandwich,reapi"
Use command "npm update amxxpack" to update AMXXPack.
Use command "npx amxxpack config" to recreate configuration file.

Example configuration file for project with Amx Mod X 1.9 and Reapi:
PHP Code:
{
  
"compiler": {
    
"version""1.9.0-git5294",
    
"dev"true,
    
"addons": ["cstrike"]
  },
  
"include": [
    
"./.compiler/include",
    
"./.thirdparty/reapi/addons/amxmodx/scripting/include"
  
],
  
"thirdparty": {
    
"dependencies": [
      {
        
"name""reapi",
        
"url""https://github.com/s1lentq/reapi/releases/download/5.21.0.252/reapi-bin-5.21.0.252.zip"
      
}
    ]
  },
  
"input": {
    
"scripts""./src/scripts",
    
"include""./src/include",
    
"assets""./assets"
  
},
  
"output": {
    
"plugins""./dist/addons/amxmodx/plugins",
    
"scripts""./dist/addons/amxmodx/scripting",
    
"include""./dist/addons/amxmodx/scripting/include",
    
"assets""./dist"
  
},
  
"rules": {
    
"flatCompilation"true
  
}

__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 02-23-2022 at 14:00.
Hedgehog Fog is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 02-23-2022 , 19:09   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #8

So, this program will allow me to collect multiple .sma files, and then compile them into one single. amxx file, correct?

This program can turn 20, for example, .sma files into one single .amxx file.

Did i understand it correctly?
GlobalPlague is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-23-2022 , 19:34   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #9

GlobalPlague,
Hi, this program is actually CLI and provides commands to work with the project. It will not compile all .sma files into single .amxx, but it will provide you the functionality to build all files and copy it to a specific folder using a single command. You are also able to use "watch" mode and AMXPack will watch script changes and automatically recompile changed plugins.
Project initialization will create the basic project structure and install the compiler to the project workspace, so you don't need to do it manually and set up anything. Just one command and you are ready to go!
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-23-2022 , 22:44   Re: 📦 [Build Tool] AMXXPack
Reply With Quote #10

Quote:
Originally Posted by GlobalPlague View Post
So, this program will allow me to collect multiple .sma files, and then compile them into one single. amxx file, correct?

This program can turn 20, for example, .sma files into one single .amxx file.

Did i understand it correctly?
If that was possible, it wouldn't make any sense to do.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode