1
// Generate an info.xml template from the version.h file.
6
#include <pluginsdk/PluginDefs.h>
7
#include <src/version.h>
11
string escape(string str) {
13
while((i = str.find_first_of("<>&", i)) != string::npos) {
15
case '<': str.replace(i, 1, "<"); i += 4; break;
16
case '>': str.replace(i, 1, ">"); i += 4; break;
17
case '&': str.replace(i, 1, "&"); i += 5; break;
24
enum { Path = 1, LastCompulsory = Path };
26
int main(int argc, char* argv[]) {
27
if(argc <= LastCompulsory) {
28
cout << "packager: no path given by the build script" << endl;
32
ofstream f(argv[Path]);
34
cout << "packager: cannot open " << argv[Path] << endl;
38
f << "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n\n"
40
"This file is an example info.xml to be included in the dcext package. For more\n"
41
"information, read \"Plugin format (dcext).txt\" in the \"doc\" directory.\n\n"
42
"This file has been generated using the information filled in the src/version.h file.\n\n"
43
"Edit the <Plugin> tags to include your plugin files.\n"
44
"If you support Windows, include pe-x64 and pe-x86 platforms.\n"
45
"If you support Linux, include elf-x64 and elf-x86 platforms.\n\n"
46
"The <Files> tag is empty; should you want to distribute additional files, include them\n"
47
"in there within <File> tags (again, more information in the above doc file).\n\n"
48
"When you are done editing this file, rename it to \"info.xml\", move the relevant files\n"
49
"to this directory and zip them; rename that .zip to .dcext and you are done!\n"
52
"\t<UUID>" << escape(PLUGIN_GUID).c_str() << "</UUID>\n"
53
"\t<Name>" << escape(PLUGIN_NAME).c_str() << "</Name>\n"
54
"\t<Version>" << PLUGIN_VERSION << "</Version>\n"
55
"\t<ApiVersion>" << DCAPI_CORE_VER << "</ApiVersion>\n"
56
"\t<Author>" << escape(PLUGIN_AUTHOR).c_str() << "</Author>\n"
57
"\t<Description>" << escape(PLUGIN_DESC).c_str() << "</Description>\n"
58
"\t<Website>" << escape(PLUGIN_WEB).c_str() << "</Website>\n"
59
"\t<Plugin Platform=\"elf-x64\">MyPlugin-x64.so</Plugin>\n"
60
"\t<Plugin Platform=\"elf-x86\">MyPlugin-x86.so</Plugin>\n"
61
"\t<Plugin Platform=\"pe-x64\">MyPlugin-x64.dll</Plugin>\n"
62
"\t<Plugin Platform=\"pe-x86\">MyPlugin-x86.dll</Plugin>\n"