[Pkg-mozext-commits] [adblock-plus] 332/464: Removed KMeleon build automation
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:44:30 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit 70513badc3596602e280959c1445dba11500fe8f
Author: Wladimir Palant <trev at adblockplus.org>
Date: Wed Nov 21 14:57:25 2012 +0100
Removed KMeleon build automation
---
build.py | 13 +--
packagerKMeleon.py | 194 --------------------------------------------
releaseAutomationKMeleon.py | 82 -------------------
3 files changed, 3 insertions(+), 286 deletions(-)
diff --git a/build.py b/build.py
index beccd12..4bc19a2 100644
--- a/build.py
+++ b/build.py
@@ -200,10 +200,6 @@ def runBuild(baseDir, scriptName, opts, args, type):
packager.createBuild(baseDir, outFile=outFile, buildNum=buildNum,
releaseBuild=releaseBuild, keyFile=keyFile,
experimentalAPI=experimentalAPI)
- elif type == 'kmeleon':
- import buildtools.packagerKMeleon as packager
- packager.createBuild(baseDir, outFile=outFile, locales=locales,
- buildNum=buildNum, releaseBuild=releaseBuild)
def runAutoInstall(baseDir, scriptName, opts, args, type):
if len(args) == 0:
@@ -402,9 +398,6 @@ def runReleaseAutomation(baseDir, scriptName, opts, args, type):
import buildtools.releaseAutomationGecko as releaseAutomation
releaseAutomation.run(baseDir, version, keyFile, downloadsRepo)
- else:
- import buildtools.releaseAutomationKMeleon as releaseAutomation
- releaseAutomation.run(baseDir, downloadsRepo, buildtoolsRepo)
def syncLocales(baseDir, scriptName, opts, args, type):
if len(args) == 0:
@@ -427,14 +420,14 @@ with addCommand(runBuild, 'build') as command:
command.shortDescription = 'Create a build'
command.description = 'Creates an extension build with given file name. If output_file is missing a default name will be chosen.'
command.params = '[options] [output_file]'
- command.addOption('Only include the given locales (if omitted: all locales not marked as incomplete)', short='l', long='locales', value='l1,l2,l3', types=('gecko', 'kmeleon'))
+ command.addOption('Only include the given locales (if omitted: all locales not marked as incomplete)', short='l', long='locales', value='l1,l2,l3', types=('gecko'))
command.addOption('Use given build number (if omitted the build number will be retrieved from Mercurial)', short='b', long='build', value='num')
command.addOption('File containing private key and certificates required to sign the package', short='k', long='key', value='file', types=('gecko', 'chrome'))
command.addOption('Create a build for leak testing', short='m', long='multi-compartment', types=('gecko'))
command.addOption('Create a release build', short='r', long='release')
command.addOption('Enable use of experimental APIs', long='experimental')
command.addOption('Create a build for Babelzilla', long='babelzilla', types=('gecko'))
- command.supportedTypes = ('gecko', 'kmeleon', 'chrome')
+ command.supportedTypes = ('gecko', 'chrome')
with addCommand(runAutoInstall, 'autoinstall') as command:
command.shortDescription = 'Install extension automatically'
@@ -490,7 +483,7 @@ with addCommand(runReleaseAutomation, 'release') as command:
command.addOption('File containing private key and certificates required to sign the release', short='k', long='key', value='file', types=('gecko'))
command.addOption('Directory containing downloads repository (if omitted ../downloads is assumed)', short='d', long='downloads', value='dir')
command.params = '[options] <version>'
- command.supportedTypes = ('gecko', 'kmeleon')
+ command.supportedTypes = ('gecko')
with addCommand(syncLocales, 'synclocales') as command:
command.shortDescription = 'Sync locales with a Firefox extension'
diff --git a/packagerKMeleon.py b/packagerKMeleon.py
deleted file mode 100644
index bb81512..0000000
--- a/packagerKMeleon.py
+++ /dev/null
@@ -1,194 +0,0 @@
-# coding: utf-8
-
-# This file is part of the Adblock Plus build tools,
-# Copyright (C) 2006-2012 Eyeo GmbH
-#
-# Adblock Plus is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3 as
-# published by the Free Software Foundation.
-#
-# Adblock Plus is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
-
-import os, subprocess, re, tempfile, shutil, json
-import buildtools.packagerGecko as packagerBase
-
-libs = (
- 'libcmt.lib', 'kernel32.lib', 'user32.lib', 'gdi32.lib', 'comctl32.lib',
- 'nspr4.lib', 'plds4.lib', 'plc4.lib', 'xpcom.lib', 'xpcomglue_s.lib',
- 'embed_base_s.lib', 'unicharutil_external_s.lib', 'js3250.lib'
-)
-compileflags = ('-c', '-O1', '-W3', '-MT', '-DXP_WIN', '-Zc:wchar_t-')
-linkflags = ('-DLL', '-NODEFAULTLIB', '-NOLOGO')
-versionflag = '-DABP_VERSION="%s"'
-
-def getKMeleonSourceDir(baseDir):
- return os.path.join(baseDir, 'kmeleon_src')
-
-def getGeckoDir(baseDir):
- return os.path.join(getKMeleonSourceDir(baseDir), 'mozilla', 'mozilla', 'dist')
-
-def getBaseExtensionDir(baseDir):
- return os.path.join(baseDir, 'adblockplus')
-
-def getIncludeDirs(baseDir):
- yield os.path.join(getKMeleonSourceDir(baseDir), 'src')
- geckoIncludeDir = os.path.join(getGeckoDir(baseDir), 'include')
- for dir in ('caps', 'content', 'dom', 'gfx', 'imglib2', 'js', 'layout',
- 'necko', 'nspr', 'pref', 'string', 'webbrwsr', 'widget', 'xpcom',
- 'xpconnect'):
- yield os.path.join(geckoIncludeDir, dir)
-
-def getLibDirs(baseDir):
- yield os.path.join(getGeckoDir(baseDir), 'lib')
-
-def getFileList(baseDir, ext):
- for file in os.listdir(baseDir):
- path = os.path.join(baseDir, file)
- if os.path.isfile(path) and file.endswith(ext):
- yield path
-
-def getSourceFiles(baseDir):
- return getFileList(baseDir, '.cpp')
-
-def getXULFiles(baseDir):
- return getFileList(baseDir, '.xul')
-
-def getMacroFiles(baseDir):
- return getFileList(baseDir, '.kmm')
-
-def getInterfaceFiles(baseDir):
- return getFileList(baseDir, '.xpt')
-
-def getModuleFiles(baseDir):
- return getFileList(baseDir, '.jsm')
-
-def getPrefsFiles(baseDir):
- return getFileList(baseDir, '.js')
-
-def buildDLL(baseDir, fileName, version):
- tempDir = tempfile.mkdtemp()
- try:
- objFiles = []
- for sourceFile in getSourceFiles(baseDir):
- objFile = os.path.join(tempDir, os.path.splitext(os.path.basename(sourceFile))[0] + '.obj')
- objFiles.append(objFile)
- command = ['cl']
- command.extend(compileflags)
- command.append(versionflag % version)
- command.extend(map(lambda d: '-I%s' % d, getIncludeDirs(baseDir)))
- command.append(sourceFile)
- command.append('-Fo%s' % objFile)
- subprocess.Popen(command).communicate()
-
- outFile = os.path.join(tempDir, fileName)
- command = ['link']
- command.extend(objFiles)
- command.extend(libs)
- command.extend(linkflags)
- command.extend(map(lambda d: '-LIBPATH:%s' % d, getLibDirs(baseDir)))
- command.append('-OUT:%s' % outFile)
- subprocess.Popen(command).communicate()
-
- handle = open(outFile, 'rb')
- result = handle.read()
- handle.close()
- return result
- finally:
- shutil.rmtree(tempDir, ignore_errors=True)
-
-def createManifest(baseExtDir, params):
- localeMetadata = packagerBase.readLocaleMetadata(baseExtDir, params['locales'])
-
- manifest = {}
- metadata = params['metadata']
- manifest['id'] = metadata.get('general', 'id')
- manifest['version'] = metadata.get('general', 'version')
- manifest['version'] = params['version']
- manifest['name'] = localeMetadata[packagerBase.defaultLocale]['name']
- manifest['description'] = localeMetadata[packagerBase.defaultLocale]['description']
- manifest['creator'] = metadata.get('general', 'author')
- manifest['homepage'] = metadata.get('homepage', 'default')
- if metadata.has_section('contributors'):
- manifest['contributors'] = map(lambda item: item[1], metadata.items('contributors'))
- manifest['contributors'].sort()
- else:
- manifest['contributors'] = []
- manifest['translators'] = packagerBase.getTranslators(localeMetadata)
- return 'var EXPORTED_SYMBOLS = ["manifest"];\nvar manifest = ' + json.dumps(manifest)
-
-def processChromeManifest(data, baseName):
- # Manifest location is different in K-Meleon, update paths
- data = re.sub(r'jar:chrome/', 'jar:', data)
- data = re.sub(r'(\s)modules/', r'\1../modules/%s/' % baseName, data)
- data = re.sub(r'(\s)defaults/', r'\1../defaults/', data)
- return data
-
-def createBuild(baseDir, outFile=None, locales=None, buildNum=None, releaseBuild=False):
- if buildNum == None:
- buildNum = packagerBase.getBuildNum(baseDir)
-
- baseExtDir = getBaseExtensionDir(baseDir)
- if locales == None:
- locales = packagerBase.getLocales(baseExtDir)
- elif locales == 'all':
- locales = packagerBase.getLocales(baseExtDir, True)
-
- metadata = packagerBase.readMetadata(baseExtDir)
- version = metadata.get('general', 'version')
- if not releaseBuild:
- version += '.' + buildNum
-
- params = {
- 'locales': locales,
- 'releaseBuild': releaseBuild,
- 'buildNum': buildNum,
- 'version': version.encode('utf-8'),
- 'metadata': metadata,
- 'limitMetadata': False,
- }
- baseName = metadata.get('general', 'basename')
-
- chromeFiles = {}
- for xulFile in getXULFiles(baseDir):
- packagerBase.readFile(chromeFiles, params, xulFile, 'content/ui/%s' % os.path.basename(xulFile))
-
- files = {}
- files['modules/%s/Manifest.jsm' % baseName] = createManifest(baseExtDir, params)
- files['kplugins/%s.dll' % baseName] = buildDLL(baseDir, '%s.dll' % baseName, version)
- files['chrome/%s.jar' % baseName] = packagerBase.createChromeJar(baseExtDir, params, files=chromeFiles)
-
- packagerBase.readFile(files, params, os.path.join(baseExtDir, 'chrome.manifest'), 'chrome/%s.manifest' % baseName)
- files['chrome/%s.manifest' % baseName] = processChromeManifest(files['chrome/%s.manifest' % baseName], baseName)
-
- for macroFile in getMacroFiles(baseDir):
- packagerBase.readFile(files, params, macroFile, 'macros/%s' % os.path.basename(macroFile))
- for interfaceFile in getInterfaceFiles(baseDir):
- packagerBase.readFile(files, params, interfaceFile, 'components/%s' % os.path.basename(interfaceFile))
- for moduleFile in getModuleFiles(baseDir):
- packagerBase.readFile(files, params, moduleFile, 'modules/%s/%s' % (baseName, os.path.basename(moduleFile)))
- for prefsFile in getPrefsFiles(baseDir):
- packagerBase.readFile(files, params, prefsFile, 'defaults/pref/%s' % os.path.basename(prefsFile))
-
- packagerBase.readFile(files, params, os.path.join(baseExtDir, 'defaults'), 'defaults')
- packagerBase.readFile(files, params, os.path.join(baseExtDir, 'modules'), 'modules/%s' %baseName)
-
- # Correct files names (defaults/preferences/ => defaults/pref/)
- newFiles = {}
- for key, value in files.iteritems():
- if key.startswith('defaults/preferences/'):
- key = 'defaults/pref/' + key[len('defaults/preferences/'):]
- newFiles[key] = value
- files = newFiles
-
- # Allow local metadata to overrite settings from base extension
- metadata.read(packagerBase.getMetadataPath(baseDir))
- if outFile == None:
- outFile = packagerBase.getDefaultFileName(baseDir, metadata, version, 'zip')
-
- packagerBase.writeXPI(files, outFile)
diff --git a/releaseAutomationKMeleon.py b/releaseAutomationKMeleon.py
deleted file mode 100644
index 9bb2a22..0000000
--- a/releaseAutomationKMeleon.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# coding: utf-8
-
-# This file is part of the Adblock Plus build tools,
-# Copyright (C) 2006-2012 Eyeo GmbH
-#
-# Adblock Plus is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3 as
-# published by the Free Software Foundation.
-#
-# Adblock Plus is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
-
-import os, re, subprocess, tarfile
-from StringIO import StringIO
-import buildtools.packagerGecko as packagerBase
-import buildtools.packagerKMeleon as packagerKMeleon
-
-def run(baseDir, downloadsRepo, buildtoolsRepo):
- baseExtDir = packagerKMeleon.getBaseExtensionDir(baseDir)
-
- # Read extension name, version and branch name
- locales = packagerBase.readLocaleMetadata(baseExtDir, [packagerBase.defaultLocale])
- extensionName = locales[packagerBase.defaultLocale]['name'] + ' for K-Meleon'
-
- metadata = packagerBase.readMetadata(baseExtDir)
- metadata.read(packagerBase.getMetadataPath(baseDir))
- branchName = metadata.get('general', 'branchname')
- version = metadata.get('general', 'version')
-
- # Tag our source repository
- subprocess.Popen(['hg', 'tag', '-R', baseDir, '-f', version]).communicate()
-
- # Create a release build
- buildPath = os.path.join(downloadsRepo, packagerBase.getDefaultFileName(baseDir, metadata, version, 'zip'))
- packagerKMeleon.createBuild(baseDir, outFile=buildPath, releaseBuild=True)
-
- # Create source archive
- archivePath = os.path.splitext(buildPath)[0] + '-source.tgz'
-
- archiveHandle = open(archivePath, 'wb')
- archive = tarfile.open(fileobj=archiveHandle, name=os.path.basename(archivePath), mode='w:gz')
- (data, dummy) = subprocess.Popen(['hg', 'archive', '-R', baseDir, '-t', 'tar', '-X', os.path.join(baseDir, '.hgtags'), '-'], stdout=subprocess.PIPE).communicate()
- repoArchive = tarfile.open(fileobj=StringIO(data), mode='r:')
- for fileInfo in repoArchive:
- fileData = repoArchive.extractfile(fileInfo)
- fileInfo.name = re.sub(r'^[^/]+/', '', fileInfo.name)
- archive.addfile(fileInfo, fileData)
- repoArchive.close()
- (data, dummy) = subprocess.Popen(['hg', 'archive', '-R', buildtoolsRepo, '-t', 'tar', '-X', os.path.join(buildtoolsRepo, '.hgtags'), '-'], stdout=subprocess.PIPE).communicate()
- repoArchive = tarfile.open(fileobj=StringIO(data), mode='r:')
- for fileInfo in repoArchive:
- fileData = repoArchive.extractfile(fileInfo)
- fileInfo.name = re.sub(r'^[^/]+/', 'buildtools/', fileInfo.name)
- archive.addfile(fileInfo, fileData)
- (data, dummy) = subprocess.Popen(['hg', 'archive', '-R', baseExtDir, '-t', 'tar', '-X', os.path.join(baseExtDir, '.hgtags'), '-'], stdout=subprocess.PIPE).communicate()
- repoArchive = tarfile.open(fileobj=StringIO(data), mode='r:')
- for fileInfo in repoArchive:
- fileData = repoArchive.extractfile(fileInfo)
- fileInfo.name = re.sub(r'^[^/]+/', '%s/' % os.path.basename(baseExtDir), fileInfo.name)
- archive.addfile(fileInfo, fileData)
- repoArchive.close()
- archive.close()
- archiveHandle.close()
-
- # Now add the downloads, commit and tag the downloads repo
- tagName = '%s_%s_RELEASE' % (branchName, version.replace('.', '_'))
- subprocess.Popen(['hg', 'add', '-R', downloadsRepo, buildPath, archivePath]).communicate()
- subprocess.Popen(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing %s %s' % (extensionName, version)]).communicate()
- subprocess.Popen(['hg', 'tag', '-R', downloadsRepo, '-f', tagName]).communicate()
-
- # Tag buildtools repository as well
- subprocess.Popen(['hg', 'tag', '-R', buildtoolsRepo, '-f', tagName]).communicate()
-
- # Push all changes
- subprocess.Popen(['hg', 'push', '-R', baseDir]).communicate()
- subprocess.Popen(['hg', 'push', '-R', downloadsRepo]).communicate()
- subprocess.Popen(['hg', 'push', '-R', buildtoolsRepo]).communicate()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list