mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
GYP/Ninja Windows build: complete, build scripts updated.
Telegram.sln deleted, in the future .sln will be in .gitignore.
This commit is contained in:
@@ -777,7 +777,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
|
||||
cpp.close();
|
||||
}
|
||||
if (write_cpp) {
|
||||
cout << "lang.cpp updated, writing " << keysOrder.size() << " rows.\n";
|
||||
if (!cpp.open(QIODevice::WriteOnly)) throw Exception("Could not open lang.cpp for writing!");
|
||||
if (cpp.write(cppText) != cppText.size()) throw Exception("Could not open lang.cpp for writing!");
|
||||
}
|
||||
@@ -791,7 +790,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
|
||||
h.close();
|
||||
}
|
||||
if (write_h) {
|
||||
cout << "lang.h updated, writing " << keysOrder.size() << " rows.\n";
|
||||
if (!h.open(QIODevice::WriteOnly)) throw Exception("Could not open lang.h for writing!");
|
||||
if (h.write(hText) != hText.size()) throw Exception("Could not open lang.h for writing!");
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "packer.h"
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
|
||||
|
@@ -47,6 +47,14 @@ Options parseOptions() {
|
||||
if (arg == "--rebuild") {
|
||||
result.rebuildDependencies = true;
|
||||
|
||||
// Skip generating style modules
|
||||
} else if (arg == "--skip-styles") {
|
||||
result.skipStyles = true;
|
||||
|
||||
// Skip generating sprite_125x.png and sprite_150x.png
|
||||
} else if (arg == "--skip-sprites") {
|
||||
result.skipSprites = true;
|
||||
|
||||
// Include paths
|
||||
} else if (arg == "-I") {
|
||||
if (++i == count) {
|
||||
|
@@ -31,6 +31,8 @@ struct Options {
|
||||
QString outputPath = ".";
|
||||
QString inputPath;
|
||||
bool rebuildDependencies = false;
|
||||
bool skipStyles = false;
|
||||
bool skipSprites = false;
|
||||
};
|
||||
|
||||
// Parsing failed if inputPath is empty in the result.
|
||||
|
@@ -65,36 +65,40 @@ int Processor::launch() {
|
||||
}
|
||||
|
||||
bool Processor::write(const structure::Module &module) const {
|
||||
QDir dir(options_.outputPath);
|
||||
if (!dir.mkpath(".")) {
|
||||
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
|
||||
return false;
|
||||
bool forceReGenerate = false;
|
||||
bool onlyStyles = options_.skipSprites;
|
||||
bool onlySprites = options_.skipStyles;
|
||||
if (!onlyStyles) {
|
||||
SpriteGenerator spriteGenerator(module, forceReGenerate);
|
||||
if (!spriteGenerator.writeSprites()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!onlySprites) {
|
||||
QDir dir(options_.outputPath);
|
||||
if (!dir.mkpath(".")) {
|
||||
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
|
||||
return false;
|
||||
}
|
||||
|
||||
QFileInfo srcFile(module.filepath());
|
||||
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
|
||||
QFileInfo srcFile(module.filepath());
|
||||
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
|
||||
|
||||
bool forceReGenerate = false;// !options_.rebuildDependencies;
|
||||
common::ProjectInfo project = {
|
||||
"codegen_style",
|
||||
srcFile.fileName(),
|
||||
"stdafx.h",
|
||||
forceReGenerate
|
||||
};
|
||||
common::ProjectInfo project = {
|
||||
"codegen_style",
|
||||
srcFile.fileName(),
|
||||
"stdafx.h",
|
||||
forceReGenerate
|
||||
};
|
||||
|
||||
SpriteGenerator spriteGenerator(module, forceReGenerate);
|
||||
if (!spriteGenerator.writeSprites()) {
|
||||
return false;
|
||||
Generator generator(module, dstFilePath, project);
|
||||
if (!generator.writeHeader()) {
|
||||
return false;
|
||||
}
|
||||
if (!generator.writeSource()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Generator generator(module, dstFilePath, project);
|
||||
if (!generator.writeHeader()) {
|
||||
return false;
|
||||
}
|
||||
if (!generator.writeSource()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user