Skip to content

Commit

Permalink
Fix GDevelop project files so they are versioned with the same versio…
Browse files Browse the repository at this point in the history
…n as the editor (#6859)

Only show in developer changelog
  • Loading branch information
f0nar authored Aug 14, 2024
1 parent 65653c9 commit 6e7fc75
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 41 deletions.
11 changes: 3 additions & 8 deletions Core/GDCore/Tools/VersionPriv.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// Deprecated version number that was used for GDevelop 4, but still
// used to version the project files.
// Might be a good idea to refactor this at some point to make it
// clearer this is used for the versioning of the project files.
#define GD_VERSION_STRING "4.0.99-0-release"
#define GD_VERSION_RC 4,0,99,0-0-release
#define GD_VERSION_RC_STRING "4, 0, 99, 0-0-release\0"
#define GD_DATE_STRING __DATE__
// This file is automatically synchronizing with newIDE/electron-app/app/package.json version
// Check GDevelop/scripts/sync-versions.js for more details
#define GD_VERSION_STRING "4.0.99-0"
9 changes: 0 additions & 9 deletions Core/GDCore/Tools/VersionWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ int VersionWrapper::Revision() {
: 0;
}
gd::String VersionWrapper::FullString() { return GD_VERSION_STRING; }
gd::String VersionWrapper::Date() {
return gd::String(GD_DATE_STRING).substr(4, 2);
}
gd::String VersionWrapper::Month() {
return gd::String(GD_DATE_STRING).substr(0, 3);
}
gd::String VersionWrapper::Year() {
return gd::String(GD_DATE_STRING).substr(7, 4);
}
gd::String VersionWrapper::Status() {
return Revision() == 0 ? "Release" : "Dev";
}
Expand Down
15 changes: 0 additions & 15 deletions Core/GDCore/Tools/VersionWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,6 @@ class GD_CORE_API VersionWrapper {
*/
static gd::String Status();

/**
* \brief Get Year of the release
*/
static gd::String Year();

/**
* \brief Get Month of the release
*/
static gd::String Month();

/**
* \brief Get Day of the release
*/
static gd::String Date();

/**
* \brief Return true if the first version is older
* than the second version.
Expand Down
3 changes: 0 additions & 3 deletions GDevelop.js/Bindings/Bindings.idl
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ interface VersionWrapper {

[Const, Value] DOMString STATIC_FullString();
[Const, Value] DOMString STATIC_Status();
[Const, Value] DOMString STATIC_Year();
[Const, Value] DOMString STATIC_Month();
[Const, Value] DOMString STATIC_Date();
};

interface Platform {
Expand Down
9 changes: 9 additions & 0 deletions GDevelop.js/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ module.exports = function (grunt) {
},
},
},
syncVersions: {
command: 'node scripts/sync-versions.js',
options: {
execOptions: {
cwd: __dirname,
},
},
}
},
clean: {
options: { force: true },
Expand All @@ -154,6 +162,7 @@ module.exports = function (grunt) {
'shell:make',
]);
grunt.registerTask('build', [
'shell:syncVersions',
'build:raw',
'shell:copyToNewIDE',
'shell:generateFlowTypes',
Expand Down
11 changes: 11 additions & 0 deletions GDevelop.js/scripts/sync-versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require('path');
const fs = require('fs');

const [gdVersion, prerelease] = require('../../newIDE/electron-app/app/package.json').version.split('-');
const versionPrivContent =
`// This file is automatically synchronizing with newIDE/electron-app/app/package.json version
// Check GDevelop/scripts/sync-versions.js for more details
#define GD_VERSION_STRING "${gdVersion}-${prerelease || 0}"
`;

fs.writeFileSync(path.join(__dirname, "../../Core/GDCore/Tools/VersionPriv.h"), versionPrivContent, "utf8");
3 changes: 0 additions & 3 deletions GDevelop.js/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ export class VersionWrapper extends EmscriptenObject {
static revision(): number;
static fullString(): string;
static status(): string;
static year(): string;
static month(): string;
static date(): string;
}

export class Platform extends EmscriptenObject {
Expand Down
3 changes: 0 additions & 3 deletions GDevelop.js/types/gdversionwrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ declare class gdVersionWrapper {
static revision(): number;
static fullString(): string;
static status(): string;
static year(): string;
static month(): string;
static date(): string;
delete(): void;
ptr: number;
};

0 comments on commit 6e7fc75

Please sign in to comment.