linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06909
[Branch ~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin] Rev 31: merge
Merge authors:
poy (poy)
------------------------------------------------------------
revno: 31 [merge]
committer: poy <poy@xxxxxxxxxx>
branch nick: DevPlugin
timestamp: Wed 2013-05-22 21:31:49 +0200
message:
merge
added:
packaging/
packaging/packager/
packaging/packager/packager.cpp
projects/vs2012/Packager.vcxproj
projects/vs2012/Packager.vcxproj.filters
modified:
.bzrignore
projects/make/Makefile
projects/vs2012/Plugin.sln
--
lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin
https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin
Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin/+edit-subscription
=== modified file '.bzrignore'
--- .bzrignore 2013-05-22 19:29:14 +0000
+++ .bzrignore 2013-05-22 19:31:49 +0000
@@ -13,6 +13,8 @@
./doc/build.bat
./doc/html
./doc/latex
+./packaging/*
+!./packaging/packager
./projects/make/build*
./projects/vs2010/Debug
./projects/vs2010/ipch
=== added directory 'packaging'
=== added directory 'packaging/packager'
=== added file 'packaging/packager/packager.cpp'
--- packaging/packager/packager.cpp 1970-01-01 00:00:00 +0000
+++ packaging/packager/packager.cpp 2013-05-22 19:19:41 +0000
@@ -0,0 +1,68 @@
+// Generate an info.xml template from the version.h file.
+
+#include <fstream>
+#include <iostream>
+
+#include <pluginsdk/PluginDefs.h>
+#include <src/version.h>
+
+using namespace std;
+
+string escape(string str) {
+ size_t i = 0;
+ while((i = str.find_first_of("<>&", i)) != string::npos) {
+ switch(str[i]) {
+ case '<': str.replace(i, 1, "<"); i += 4; break;
+ case '>': str.replace(i, 1, ">"); i += 4; break;
+ case '&': str.replace(i, 1, "&"); i += 5; break;
+ default: ++i; break;
+ }
+ }
+ return str;
+}
+
+enum { Path = 1, LastCompulsory = Path };
+
+int main(int argc, char* argv[]) {
+ if(argc <= LastCompulsory) {
+ cout << "packager: no path given by the build script" << endl;
+ return 1;
+ }
+
+ ofstream f(argv[Path]);
+ if(!f.is_open()) {
+ cout << "packager: cannot open " << argv[Path] << endl;
+ return 2;
+ }
+
+ f << "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n\n"
+ "<!--\n"
+ "This file is an example info.xml to be included in the dcext package. For more\n"
+ "information, read \"Plugin format (dcext).txt\" in the \"doc\" directory.\n\n"
+ "This file has been generated using the information filled in the src/version.h file.\n\n"
+ "Edit the <Plugin> tags to include your plugin files.\n"
+ "If you support Windows, include pe-x64 and pe-x86 platforms.\n"
+ "If you support Linux, include elf-x64 and elf-x86 platforms.\n\n"
+ "The <Files> tag is empty; should you want to distribute additional files, include them\n"
+ "in there within <File> tags (again, more information in the above doc file).\n\n"
+ "When you are done editing this file, rename it to \"info.xml\", move the relevant files\n"
+ "to this directory and zip them; rename that .zip to .dcext and you are done!\n"
+ "-->\n\n"
+ "<dcext>\n"
+ "\t<UUID>" << escape(PLUGIN_GUID).c_str() << "</UUID>\n"
+ "\t<Name>" << escape(PLUGIN_NAME).c_str() << "</Name>\n"
+ "\t<Version>" << PLUGIN_VERSION << "</Version>\n"
+ "\t<ApiVersion>" << DCAPI_CORE_VER << "</ApiVersion>\n"
+ "\t<Author>" << escape(PLUGIN_AUTHOR).c_str() << "</Author>\n"
+ "\t<Description>" << escape(PLUGIN_DESC).c_str() << "</Description>\n"
+ "\t<Website>" << escape(PLUGIN_WEB).c_str() << "</Website>\n"
+ "\t<Plugin Platform=\"elf-x64\">MyPlugin-x64.so</Plugin>\n"
+ "\t<Plugin Platform=\"elf-x86\">MyPlugin-x86.so</Plugin>\n"
+ "\t<Plugin Platform=\"pe-x64\">MyPlugin-x64.dll</Plugin>\n"
+ "\t<Plugin Platform=\"pe-x86\">MyPlugin-x86.dll</Plugin>\n"
+ "\t<Files>\n"
+ "\t</Files>\n"
+ "</dcext>\n";
+
+ return 0;
+}
=== modified file 'projects/make/Makefile'
--- projects/make/Makefile 2013-05-13 17:40:32 +0000
+++ projects/make/Makefile 2013-05-22 19:31:49 +0000
@@ -35,8 +35,10 @@
COMPILER_SPEC = $(shell $(CC) -dumpmachine)
ifeq ($(findstring mingw, $(COMPILER_SPEC)),)
+ BINEXT =
LIBEXT = .so
else
+ BINEXT = .exe
CPPFLAGS += -D_WIN32_WINNT=0x502 -DWINVER=0x502 -D_WIN32_IE=0x600 \
-DNOMINMAX -DSTRICT -DWIN32_LEAN_AND_MEAN \
-DWIN32 -D_WIN32 -DUNICODE -D_UNICODE
@@ -123,11 +125,20 @@
TARGET := $(OUTPUT_DIR)/$(TARGET)$(LIBEXT)
OBJS := $(addprefix $(OUTPUT_DIR)/, $(OBJS))
-all: $(TARGET)
+PACKAGER = $(OUTPUT_DIR)/packaging/packager$(BINEXT)
+PACK_INFO = ../../packaging/info_generated.xml
+
+all: $(TARGET) $(PACK_INFO)
$(TARGET): $(OBJS)
$(CXX) $^ $(LINKFLAGS) $(LINKXXFLAGS) $(OUTPUT_OPTION)
+$(PACKAGER): $(OUTPUT_DIR)/packaging/packager/packager.o
+ $(CXX) $^ $(subst -shared,,$(LINKFLAGS) $(LINKXXFLAGS)) $(OUTPUT_OPTION)
+
+$(PACK_INFO): $(PACKAGER)
+ $(PACKAGER) $(PACK_INFO)
+
$(OUTPUT_DIR)/%.o: %.c
$(COMPILE.c) $< $(OUTPUT_OPTION)
@@ -139,7 +150,10 @@
$(OBJS): | $(OUTPUT_DIR)
+$(PACKAGER): | $(OUTPUT_DIR)
+
$(OUTPUT_DIR):
+ $(call MKDIR,$(OUTPUT_DIR)/packaging/packager)
$(call MKDIR,$(OUTPUT_DIR)/pluginsdk)
$(call MKDIR,$(OUTPUT_DIR)/src)
$(call MKDIR,$(OUTPUT_DIR)/boost/libs/atomic/src)
=== added file 'projects/vs2012/Packager.vcxproj'
--- projects/vs2012/Packager.vcxproj 1970-01-01 00:00:00 +0000
+++ projects/vs2012/Packager.vcxproj 2013-05-22 19:19:41 +0000
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{D21D696B-AC15-4706-874A-D8F801202D4B}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>Packager</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v110</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <PostBuildEvent>
+ <Command>$(TargetPath) ../../packaging/info_generated.xml</Command>
+ </PostBuildEvent>
+ <PostBuildEvent>
+ <Message>Generating info_generated.xml</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PostBuildEvent>
+ <Command>$(TargetPath) ../../packaging/info_generated.xml</Command>
+ </PostBuildEvent>
+ <PostBuildEvent>
+ <Message>Generating info_generated.xml</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\src\version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\packaging\packager\packager.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
=== added file 'projects/vs2012/Packager.vcxproj.filters'
--- projects/vs2012/Packager.vcxproj.filters 1970-01-01 00:00:00 +0000
+++ projects/vs2012/Packager.vcxproj.filters 2013-05-22 19:19:41 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\src\version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\packaging\packager\packager.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
=== modified file 'projects/vs2012/Plugin.sln'
--- projects/vs2012/Plugin.sln 2012-11-15 18:17:16 +0000
+++ projects/vs2012/Plugin.sln 2013-05-22 19:19:41 +0000
@@ -3,6 +3,8 @@
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin", "Plugin.vcxproj", "{B5273AD8-8E53-46CD-8797-65FE814DBFB0}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packager", "Packager.vcxproj", "{D21D696B-AC15-4706-874A-D8F801202D4B}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -13,6 +15,10 @@
{B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Debug|Win32.Build.0 = Debug|Win32
{B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Release|Win32.ActiveCfg = Release|Win32
{B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Release|Win32.Build.0 = Release|Win32
+ {D21D696B-AC15-4706-874A-D8F801202D4B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D21D696B-AC15-4706-874A-D8F801202D4B}.Debug|Win32.Build.0 = Debug|Win32
+ {D21D696B-AC15-4706-874A-D8F801202D4B}.Release|Win32.ActiveCfg = Release|Win32
+ {D21D696B-AC15-4706-874A-D8F801202D4B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE