Unverified 提交 b577fdfb authored 作者: José Luis Millán's avatar José Luis Millán 提交者: GitHub

Remove clang tools binaries from regular installation (#572)

Remove clang tools binaries from regular installation
上级 8e687940
......@@ -68,5 +68,6 @@ jobs:
${{ matrix.build.os }}-node-${{matrix.build.cc}}-
- run: npm install
- run: npm run install-clang-tools
- run: npm run lint:worker
- run: npm run test:worker
......@@ -29,6 +29,8 @@
# Python generated stuff in Windows.
/worker/scripts/configure.pyc
# worker scripts node-modules.
/worker/scripts/node_modules/
# Vistual Studio generated Stuff.
/worker/**/Debug/
......
......@@ -7,8 +7,6 @@ const { version } = require('./package.json');
const isWindows = os.platform() === 'win32';
const task = process.argv.slice(2).join(' ');
const GULP = process.env.GULP || 'gulp';
// mediasoup mayor version.
const MAYOR_VERSION = 3;
......@@ -72,21 +70,21 @@ switch (task)
case 'lint:node':
{
execute('cross-env MEDIASOUP_NODE_LANGUAGE=typescript eslint -c .eslintrc.js --max-warnings 0 --ext=ts src/');
execute('cross-env MEDIASOUP_NODE_LANGUAGE=javascript eslint -c .eslintrc.js --max-warnings 0 --ext=js --ignore-pattern \'!.eslintrc.js\' .eslintrc.js gulpfile.js npm-scripts.js test/');
execute('cross-env MEDIASOUP_NODE_LANGUAGE=javascript eslint -c .eslintrc.js --max-warnings 0 --ext=js --ignore-pattern \'!.eslintrc.js\' .eslintrc.js npm-scripts.js test/ worker/scripts/gulpfile.js');
break;
}
case 'lint:worker':
{
execute(`${GULP} lint:worker`);
execute('make lint -C worker');
break;
}
case 'format:worker':
{
execute(`${GULP} format:worker`);
execute('make format -C worker');
break;
}
......@@ -163,6 +161,13 @@ switch (task)
break;
}
case 'install-clang-tools':
{
execute('npm install --prefix worker/scripts');
break;
}
default:
{
throw new TypeError(`unknown task "${task}"`);
......
......@@ -28,6 +28,7 @@
"node": ">=10"
},
"scripts": {
"install-clang-tools": "node npm-scripts.js install-clang-tools",
"typescript:build": "node npm-scripts.js typescript:build",
"typescript:watch": "node npm-scripts.js typescript:watch",
"lint": "npm run lint:node && npm run lint:worker",
......@@ -65,16 +66,11 @@
"cross-env": "^7.0.3",
"eslint": "^7.27.0",
"eslint-plugin-jest": "^24.3.6",
"gulp": "^4.0.2",
"gulp-clang-format": "^1.0.27",
"jest": "^27.0.3",
"jest-tobetype": "^1.2.3",
"open-cli": "^6.0.1",
"sctp": "^1.0.0",
"tsc-watch": "^4.4.0",
"typescript": "~3.8.3"
},
"optionalDependencies": {
"clang-tools-prebuilt": "^0.1.4"
}
}
......@@ -9,7 +9,7 @@ ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CORES ?= $(shell ${ROOT_DIR}/scripts/cpu_cores.sh || echo 4)
MEDIASOUP_OUT_DIR ?= out
MEDIASOUP_BUILDTYPE ?= Release
GULP = ../node_modules/.bin/gulp
GULP = ./scripts/node_modules/.bin/gulp
LCOV = ./deps/lcov/bin/lcov
BEAR ?= bear
SED ?= sed
......@@ -56,10 +56,10 @@ xcode:
$(PYTHON) ./scripts/configure.py --format=xcode
lint:
$(GULP) lint:worker
$(GULP) --gulpfile ./scripts/gulpfile.js lint:worker
format:
$(GULP) format:worker
$(GULP) --gulpfile ./scripts/gulpfile.js format:worker
test:
ifeq ($(MEDIASOUP_WORKER_BIN),)
......@@ -77,8 +77,8 @@ bear:
tidy:
$(SED) "s|PATH|$(PWD)|g" compile_commands_template.json > compile_commands.json
$(PYTHON) ./scripts/clang-tidy.py \
-clang-tidy-binary=../node_modules/.bin/clang-tidy \
-clang-apply-replacements-binary=../node_modules/.bin/clang-apply-replacements \
-clang-tidy-binary=./scripts/node_modules/.bin/clang-tidy \
-clang-apply-replacements-binary=./scripts/node_modules/.bin/clang-apply-replacements \
-header-filter='(Channel/**/*.hpp|DepLibSRTP.hpp|DepLibUV.hpp|DepLibWebRTC.hpp|DepOpenSSL.hpp|DepUsrSCTP.hpp|LogLevel.hpp|Logger.hpp|MediaSoupError.hpp|RTC/**/*.hpp|Settings.hpp|Utils.hpp|Worker.hpp|common.hpp|handles/**/*.hpp)' \
-p=. \
-j=$(CORES) \
......
......@@ -3,12 +3,12 @@ const clangFormat = require('gulp-clang-format');
const workerFiles =
[
'worker/src/**/*.cpp',
'worker/include/**/*.hpp',
'worker/test/src/**/*.cpp',
'worker/test/include/helpers.hpp',
'worker/fuzzer/src/**/*.cpp',
'worker/fuzzer/include/**/*.hpp'
'../src/**/*.cpp',
'../include/**/*.hpp',
'../test/src/**/*.cpp',
'../test/include/helpers.hpp',
'../fuzzer/src/**/*.cpp',
'../fuzzer/include/**/*.hpp'
];
gulp.task('lint:worker', () =>
......
{
"name": "clang-tools",
"version": "0.0.1",
"description": "mediasoup worker dev tools",
"devDependencies": {
"clang-tools-prebuilt": "^0.1.4",
"gulp": "^4.0.2",
"gulp-clang-format": "^1.0.27"
}
}
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论