diff --git a/.github/workflows/msbuild.yml b/.github/workflows/build_package.yml similarity index 93% rename from .github/workflows/msbuild.yml rename to .github/workflows/build_package.yml index c10369a3..8f1f9a26 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/build_package.yml @@ -1,4 +1,4 @@ -name: Backend build +name: Build & package on: push: @@ -33,6 +33,6 @@ jobs: - name: Upload a Build Artifact uses: actions/upload-artifact@v3.1.3 with: - name: Installer + name: latest path: installer/Output/*.exe diff --git a/.gitignore b/.gitignore index 8158b6e4..b52aef9d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ hgt /src/html /src/latex +client/public/stylesheets/leaflet/leaflet-gesture-handling.css +client/public/javascripts/leaflet.nauticscale.js +client/public/javascripts/L.Path.Drag.js diff --git a/build.bat b/build.bat index 7e42d41e..6100e201 100644 --- a/build.bat +++ b/build.bat @@ -1,4 +1,4 @@ -call git clean -fx +call node increase_version.js cd src msbuild olympus.sln /t:Build /p:Configuration=Release diff --git a/client/bin/www b/client/bin/www index 6d72067e..d4015a1f 100644 --- a/client/bin/www +++ b/client/bin/www @@ -112,7 +112,7 @@ function onListening() { debug('Listening on ' + bind); } -console.log("DCS Olympus server v1.0.2 started correctly!") +console.log("DCS Olympus server {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} started correctly!") console.log("Waiting for connections...") -process.title = `DCS Olympus server v1.0.2 (${port})`; \ No newline at end of file +process.title = `DCS Olympus server {{OLYMPUS_VERSION_NUMBER}} (${port})`; \ No newline at end of file diff --git a/client/configurator.js b/client/configurator.js index 841cfd20..c7c588a0 100644 --- a/client/configurator.js +++ b/client/configurator.js @@ -42,7 +42,7 @@ async function run() { console.log('\x1b[36m%s\x1b[0m', "*********************************************************************"); console.log('\x1b[36m%s\x1b[0m', ""); - console.log("DCS Olympus configurator v1.0.2"); + console.log("DCS Olympus configurator {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}"); console.log(""); var newValue; diff --git a/client/package.json b/client/package.json index 9afa5247..30f49fc0 100644 --- a/client/package.json +++ b/client/package.json @@ -2,7 +2,7 @@ "name": "DCSOlympus", "node-main": "./bin/www", "main": "http://localhost:3000", - "version": "v1.0.2", + "version": "{{OLYMPUS_VERSION_NUMBER}}", "private": true, "scripts": { "build": "browserify .\\src\\index.ts --debug -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && copy.bat", diff --git a/client/src/olympusapp.ts b/client/src/olympusapp.ts index 7a937929..dc45db8c 100644 --- a/client/src/olympusapp.ts +++ b/client/src/olympusapp.ts @@ -29,7 +29,7 @@ import { UnitListPanel } from "./panels/unitlistpanel"; import { ContextManager } from "./context/contextmanager"; import { Context } from "./context/context"; -var VERSION = "v1.0.2"; +var VERSION = "{{OLYMPUS_VERSION_NUMBER}}"; var DEBUG = false; export class OlympusApp { diff --git a/client/views/other/dialogs/splash.ejs b/client/views/other/dialogs/splash.ejs index e7204171..1084d345 100644 --- a/client/views/other/dialogs/splash.ejs +++ b/client/views/other/dialogs/splash.ejs @@ -3,7 +3,7 @@

DCS Olympus

Dynamic Unit Command

-
Version v1.0.2
+
Version {{OLYMPUS_VERSION_NUMBER}}
Latest version
diff --git a/client/views/toolbars/primary.ejs b/client/views/toolbars/primary.ejs index e804957a..07e129ad 100644 --- a/client/views/toolbars/primary.ejs +++ b/client/views/toolbars/primary.ejs @@ -6,7 +6,7 @@

DCS Olympus

-
version v1.0.2
+
version {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}
Discord diff --git a/increase_version.js b/increase_version.js new file mode 100644 index 00000000..7f14bdb0 --- /dev/null +++ b/increase_version.js @@ -0,0 +1,77 @@ +const path = require("path"); +const fs = require("fs"); +let files = []; + +const revision = require('child_process').execSync('git rev-parse --short HEAD').toString().trim(); + +function throughDirectory(directory) { + fs.readdirSync(directory).forEach(file => { + const absolute = path.join(directory, file); + if (!file.includes("increase_version.js")) { + if (fs.statSync(absolute).isDirectory()) + { + return throughDirectory(absolute); + } + else { + return files.push(absolute); + } + } + }); +} + +fs.readFile("./version.json", "utf8", (error, data) => { + if (error) { + console.log(error); + return; + } + const versionJSON = JSON.parse(data); + var version = versionJSON["version"]; + console.log(`Setting version number to ${version}`); + version = version.replace("v", ""); + var arr = version.split("."); + const major = arr[0]; + const minor = arr[1]; + const minorminor = arr[2]; + + throughDirectory("."); + + files.forEach((file) => { + fs.readFile(file, 'utf8', function (err,data) { + if (err) { + return console.log(err); + } + if (data.search(/{{OLYMPUS_VERSION_NUMBER}}/g) >= 0) { + console.log(`Replacing version in ${file}`); + + var result = data.replace(/{{OLYMPUS_VERSION_NUMBER}}/g, `v${major}.${minor}.${minorminor}`); + result = result.replace(/{{OLYMPUS_COMMIT_HASH}}/g, revision); + + fs.writeFile(file, result, 'utf8', (err) => { + if (err) return console.log(err); + }); + } + + if (data.search(/1,0,2/g) >= 0) { + console.log(`Replacing version in ${file}`); + + var result = data.replace(/1,0,2/g, `${major},${minor},${minorminor}`); + + fs.writeFile(file, result, 'utf8', (err) => { + if (err) return console.log(err); + }); + } + + if (data.search(/{{OLYMPUS_VS_VERSION_NUMBER_2}}/g) >= 0) { + console.log(`Replacing version in ${file}`); + + var result = data.replace(/{{OLYMPUS_VS_VERSION_NUMBER_2}}/g, `${major}.${minor}.${minorminor}`); + + fs.writeFile(file, result, 'utf8', (err) => { + if (err) return console.log(err); + }); + } + }); + }); +}); + + diff --git a/installer/archive/INSTRUCTIONS.txt b/installer/archive/INSTRUCTIONS.txt index 0332809b..fe251128 100644 --- a/installer/archive/INSTRUCTIONS.txt +++ b/installer/archive/INSTRUCTIONS.txt @@ -7,7 +7,7 @@ __/ | | | |___/ |_| -v1.0.2 +{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} INSTALLATION INSTRUCTIONS diff --git a/installer/installer/INSTRUCTIONS.txt b/installer/installer/INSTRUCTIONS.txt index b0948fe7..2833cb4f 100644 --- a/installer/installer/INSTRUCTIONS.txt +++ b/installer/installer/INSTRUCTIONS.txt @@ -7,7 +7,7 @@ __/ | | | |___/ |_| -v1.0.2 +{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} INSTALLATION INSTRUCTIONS diff --git a/installer/olympus.iss b/installer/olympus.iss index 0aeb605a..f1aed65a 100644 --- a/installer/olympus.iss +++ b/installer/olympus.iss @@ -1,4 +1,4 @@ -#define version "v1.0.2" +#define version "{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}" [Setup] AppName=DCS Olympus diff --git a/mod/entry.lua b/mod/entry.lua index 2ff0d019..853ad5e3 100644 --- a/mod/entry.lua +++ b/mod/entry.lua @@ -15,7 +15,7 @@ declare_plugin(self_ID, shortName = "Olympus", fileMenuName = "Olympus", - version = "v1.0.2", + version = "{{OLYMPUS_VERSION_NUMBER}}", state = "installed", developerName= "DCS Refugees 767 squadron", info = _("DCS Olympus is a mod for DCS World. It allows users to spawn, control, task, group, and remove units from a DCS World server using a real-time map interface, similarly to Real Time Strategy games. The user interface also provides useful informations units, like loadouts, fuel, tasking, and so on. In the future, more features for DCS World GCI and JTAC will be available."), diff --git a/scripts/OlympusCommand.lua b/scripts/OlympusCommand.lua index c6533a70..f218c3c6 100644 --- a/scripts/OlympusCommand.lua +++ b/scripts/OlympusCommand.lua @@ -1,4 +1,4 @@ -local version = "v1.0.2" +local version = "{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}" local debug = false -- True enables debug printing using DCS messages diff --git a/scripts/OlympusHook.lua b/scripts/OlympusHook.lua index 5451b25b..84f3babd 100644 --- a/scripts/OlympusHook.lua +++ b/scripts/OlympusHook.lua @@ -1,4 +1,4 @@ -local version = 'v1.0.2' +local version = '{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}' local lfs = require("lfs") Olympus = {} diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj index 97f0add6..3e004206 100644 --- a/src/core/core.vcxproj +++ b/src/core/core.vcxproj @@ -182,7 +182,7 @@ false lua.lib; GeographicLib-i.lib;%(AdditionalDependencies) ..\..\third-party\lua - v1.0.2 + {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} diff --git a/src/dcstools/dcstools.rc b/src/dcstools/dcstools.rc index c0e642f6..d44a7214 100644 --- a/src/dcstools/dcstools.rc +++ b/src/dcstools/dcstools.rc @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,1,0 - PRODUCTVERSION 1,0,1,0 + FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 + PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "DCS Olympus" VALUE "FileDescription", "DCS Olympus" - VALUE "FileVersion", "1.0.2.0" + VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" VALUE "InternalName", "dcstools.dll" VALUE "LegalCopyright", "Copyright (C) 2023" VALUE "OriginalFilename", "dcstools.dll" VALUE "ProductName", "DCS Olympus" - VALUE "ProductVersion", "1.0.2.0" + VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" END END BLOCK "VarFileInfo" diff --git a/src/dcstools/dcstools.vcxproj b/src/dcstools/dcstools.vcxproj index 9ad46ea6..93b24649 100644 --- a/src/dcstools/dcstools.vcxproj +++ b/src/dcstools/dcstools.vcxproj @@ -142,7 +142,7 @@ Windows true false - v1.0.2 + {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} diff --git a/src/logger/logger.rc b/src/logger/logger.rc index 981cc53a..519a4f51 100644 --- a/src/logger/logger.rc +++ b/src/logger/logger.rc @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,1,0 - PRODUCTVERSION 1,0,1,0 + FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 + PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "DCS Olympus" VALUE "FileDescription", "DCS Olympus" - VALUE "FileVersion", "1.0.2.0" + VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" VALUE "InternalName", "logger.dll" VALUE "LegalCopyright", "Copyright (C) 2023" VALUE "OriginalFilename", "logger.dll" VALUE "ProductName", "DCS Olympus" - VALUE "ProductVersion", "1.0.2.0" + VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" END END BLOCK "VarFileInfo" diff --git a/src/logger/logger.vcxproj b/src/logger/logger.vcxproj index 158ab316..57cbd658 100644 --- a/src/logger/logger.vcxproj +++ b/src/logger/logger.vcxproj @@ -141,7 +141,7 @@ Windows true false - v1.0.2 + {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} diff --git a/src/luatools/luatools.rc b/src/luatools/luatools.rc index 232068ef..37a3f4d2 100644 --- a/src/luatools/luatools.rc +++ b/src/luatools/luatools.rc @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,1,0 - PRODUCTVERSION 1,0,1,0 + FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 + PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "DCS Olympus" VALUE "FileDescription", "DCS Olympus" - VALUE "FileVersion", "1.0.2.0" + VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" VALUE "InternalName", "luatools.dll" VALUE "LegalCopyright", "Copyright (C) 2023" VALUE "OriginalFilename", "luatools.dll" VALUE "ProductName", "DCS Olympus" - VALUE "ProductVersion", "1.0.2.0" + VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" END END BLOCK "VarFileInfo" diff --git a/src/luatools/luatools.vcxproj b/src/luatools/luatools.vcxproj index 1f2ff45e..331d31d5 100644 --- a/src/luatools/luatools.vcxproj +++ b/src/luatools/luatools.vcxproj @@ -125,7 +125,7 @@ Windows true false - v1.0.2 + {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} diff --git a/src/olympus/olympus.rc b/src/olympus/olympus.rc index dbf080d9..654fba2f 100644 --- a/src/olympus/olympus.rc +++ b/src/olympus/olympus.rc @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,1,0 - PRODUCTVERSION 1,0,1,0 + FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 + PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "DCS Olympus" VALUE "FileDescription", "DCS Olympus" - VALUE "FileVersion", "1.0.2.0" + VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" VALUE "InternalName", "olympus.dll" VALUE "LegalCopyright", "Copyright (C) 2023" VALUE "OriginalFilename", "olympus.dll" VALUE "ProductName", "DCS Olympus" - VALUE "ProductVersion", "1.0.2.0" + VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0" END END BLOCK "VarFileInfo" diff --git a/src/olympus/olympus.vcxproj b/src/olympus/olympus.vcxproj index 107e8423..ad4980cf 100644 --- a/src/olympus/olympus.vcxproj +++ b/src/olympus/olympus.vcxproj @@ -95,7 +95,7 @@ false lua.lib ..\..\third-party\lua - v1.0.2 + {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} diff --git a/src/shared/include/defines.h b/src/shared/include/defines.h index 52b986b4..ca1916a3 100644 --- a/src/shared/include/defines.h +++ b/src/shared/include/defines.h @@ -1,6 +1,6 @@ #pragma once -#define VERSION "v1.0.2" +#define VERSION "{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}" #define LOG_NAME "Olympus_log.txt" #define REST_ADDRESS "http://localhost:30000" #define REST_URI "olympus" diff --git a/version.json b/version.json index a0587f81..a0c45154 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "v1.0.2" + "version": "v1.0.3" }