AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   [Build Tool] AMXXPack (https://forums.alliedmods.net/showthread.php?t=336438)

Hedgehog Fog 02-19-2022 23:35

[Build Tool] AMXXPack
 

📦 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

Hedgehog Fog 02-19-2022 23:35

Re: [Build Tool] AMXXPack
 
Reserved

bigdaddy424 02-20-2022 00:07

Re: 📦 [Build Tool] AMXXPack
 
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

fysiks 02-20-2022 05:25

Re: 📦 [Build Tool] AMXXPack
 
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).

Hedgehog Fog 02-20-2022 07:40

Re: 📦 [Build Tool] AMXXPack
 
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
  
}



Hedgehog Fog 02-21-2022 11:25

Re: 📦 [Build Tool] AMXXPack
 
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

Hedgehog Fog 02-23-2022 13:32

Re: 📦 [Build Tool] AMXXPack
 
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
  
}



GlobalPlague 02-23-2022 19:09

Re: 📦 [Build Tool] AMXXPack
 
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?

Hedgehog Fog 02-23-2022 19:34

Re: 📦 [Build Tool] AMXXPack
 
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!

fysiks 02-23-2022 22:44

Re: 📦 [Build Tool] AMXXPack
 
Quote:

Originally Posted by GlobalPlague (Post 2772269)
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.


All times are GMT -4. The time now is 11:56.

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