From 11b8f4a951946acb72f0d76ea86630e34c698073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Csord=C3=A1s?= Date: Tue, 13 Apr 2021 09:11:44 +0200 Subject: [PATCH] [web] Get CodeChecker API version automatically in webpack Getchecker-api` package version automatically during webpack build from the module instead of changing it manually on every package update. --- docs/web/api/README.md | 2 -- web/server/vue-cli/config/webpack.common.js | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/web/api/README.md b/docs/web/api/README.md index 4052e129f9..46e3da4551 100644 --- a/docs/web/api/README.md +++ b/docs/web/api/README.md @@ -60,8 +60,6 @@ already existing functions, only extend the API: `codechecker_web/shared/version.py`. This dict stores for each major version, which is the highest supported minor version. In this case, simply increase the number by `1`. - 2. Change the `web/server/www/scripts/version.js` file to represent the newest - version, e.g. `6.1`. ### Major API changes diff --git a/web/server/vue-cli/config/webpack.common.js b/web/server/vue-cli/config/webpack.common.js index 1ef184d3db..ce8f5441e2 100644 --- a/web/server/vue-cli/config/webpack.common.js +++ b/web/server/vue-cli/config/webpack.common.js @@ -6,12 +6,15 @@ const { DefinePlugin } = require('webpack'); const { join } = require('path'); +const codeCheckerApi = require('codechecker-api/package.json'); + const helpers = require('./helpers'); +const apiVersion = codeCheckerApi.version.split('.').slice(0, 2).join('.'); const METADATA = { 'CC_SERVER_HOST': null, 'CC_SERVER_PORT': 80, - 'CC_API_VERSION': JSON.stringify('6.39') + 'CC_API_VERSION': JSON.stringify(apiVersion) }; function sassLoaderOptions(indentedSyntax=false) {