← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3136: scons pluginsdk=1 to package the plugin SDK

 

------------------------------------------------------------
revno: 3136
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2012-11-12 20:09:53 +0100
message:
  scons pluginsdk=1 to package the plugin SDK
added:
  pluginsdk/SConscript
modified:
  .bzrignore
  SConstruct


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file '.bzrignore'
--- .bzrignore	2012-11-12 18:26:21 +0000
+++ .bzrignore	2012-11-12 19:09:53 +0000
@@ -24,6 +24,7 @@
 ./msvc/debug-*
 ./msvc/release-*
 ./mingw/include/*.h
+./pluginsdk/c/pluginsdk/PluginDefs.h
 ./pluginsdk/cpp/pluginsdk/PluginDefs.h
 ./pluginsdk/cpp/projects/make/build
 ./pluginsdk/cpp/projects/vs2010/Debug

=== modified file 'SConstruct'
--- SConstruct	2012-11-11 16:16:24 +0000
+++ SConstruct	2012-11-12 19:09:53 +0000
@@ -105,7 +105,8 @@
 	EnumVariable('arch', 'Target architecture', 'x86', ['x86', 'x64', 'ia64']),
 	ListVariable('plugins', 'The plugins to compile', 'all', plugins),
 	BoolVariable('msvcproj', 'Build MSVC project files', 'no'),
-	BoolVariable('distro', 'Produce the official distro (forces tools=mingw, mode=release, unicode=1, i18n=1, help=1, webhelp=1, arch=x86)', 'no')
+	BoolVariable('distro', 'Produce the official distro (forces tools=mingw, mode=release, unicode=1, i18n=1, help=1, webhelp=1, arch=x86)', 'no'),
+	BoolVariable('pluginsdk', 'Package the plugin SDK', 'no')
 )
 
 opts.Update(defEnv)
@@ -290,4 +291,5 @@
 dev.utils = dev.build('utils/')
 dev.win32 = dev.build('win32/')
 dev.installer = dev.build('installer/')
+dev.pluginsdk = dev.build('pluginsdk/')
 dev.finalize()

=== added file 'pluginsdk/SConscript'
--- pluginsdk/SConscript	1970-01-01 00:00:00 +0000
+++ pluginsdk/SConscript	2012-11-12 19:09:53 +0000
@@ -0,0 +1,27 @@
+# Package the DC++ plugin SDK; build one package for each language
+# Dependencies:
+# - zip (MSYS / Cygwin provide one)
+
+Import('dev')
+env = dev.env.Clone()
+
+if not env['pluginsdk']:
+	Return()
+
+if env.WhereIs('zip') is None:
+	raise Exception('"zip" is required to build the distro; get the one from MSYS or Cygwin')
+
+from build_util import nixify
+
+def gen_zip(target, source, env):
+	source_dir = str(source[0])
+
+	# make sure PluginDefs.h is here
+	env.Execute(Copy(source_dir + '/pluginsdk', 'pluginsdk/PluginDefs.h'))
+
+	# create the zip file
+	return env.Execute('cd "' + source_dir + '" && zip -9 -r "' + nixify(str(target[0].abspath)) + '" . -x "projects/make/build\\*" -x "projects/vs2010/Debug\\*" -x "projects/vs2010/ipch\\*" -x "projects/vs2010/Release\\*" -x "projects/vs2012/Debug\\*" -x "projects/vs2012/Release\\*" -x "\\*.sdf" -x "\\*.suo" -x "\\*.vcxproj.user" && cd "' + env.Dir('#').abspath + '"')
+
+build_path = '#/build/pluginsdk/'
+for kind in ['cpp']: # TODO add 'c'
+	env.Command(build_path + 'dcpp_plugin_sdk_' + kind + '.zip', kind, Action(gen_zip, 'Plugin SDK: packaging $TARGET'))