[Pkg-javascript-commits] [jquery] 09/10: Reproduce grunt build

Antonio Terceiro terceiro at moszumanska.debian.org
Fri Aug 21 18:46:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository jquery.

commit 1165613c817878bfb0e267c7d38782ebf3bffbac
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Fri Aug 21 18:29:11 2015 +0200

    Reproduce grunt build
    
    The final dist/jquery.js is identical to the one created by grunt,
    except for comments and whitespace (empty lines).
---
 debian/build-1.11.3.txt | 78 +++++++++++++++++++++++++++++++++++++++++++++++++
 debian/build.js         | 60 +++++++++++++++++++++++++++++++++++++
 debian/build.mk         | 20 +++++++++++++
 debian/changelog        |  7 +++++
 debian/control          |  2 +-
 debian/install          |  1 -
 debian/rules            | 20 ++++++-------
 7 files changed, 176 insertions(+), 12 deletions(-)

diff --git a/debian/build-1.11.3.txt b/debian/build-1.11.3.txt
new file mode 100644
index 0000000..f49e8f8
--- /dev/null
+++ b/debian/build-1.11.3.txt
@@ -0,0 +1,78 @@
+src/var/deletedIds.js
+src/var/slice.js
+src/var/concat.js
+src/var/push.js
+src/var/indexOf.js
+src/var/class2type.js
+src/var/toString.js
+src/var/hasOwn.js
+src/var/support.js
+src/core.js
+src/sizzle/dist/sizzle.js
+src/selector-sizzle.js
+src/selector.js
+src/traversing/var/rneedsContext.js
+src/core/var/rsingleTag.js
+src/traversing/findFilter.js
+src/core/init.js
+src/traversing.js
+src/var/rnotwhite.js
+src/callbacks.js
+src/deferred.js
+src/core/ready.js
+src/var/strundefined.js
+src/support.js
+src/data/support.js
+src/data/accepts.js
+src/data.js
+src/queue.js
+src/var/pnum.js
+src/css/var/cssExpand.js
+src/css/var/isHidden.js
+src/core/access.js
+src/manipulation/var/rcheckableType.js
+src/manipulation/support.js
+src/event/support.js
+src/event.js
+src/manipulation.js
+src/css/defaultDisplay.js
+src/effects/support.js
+src/css/var/rmargin.js
+src/css/var/rnumnonpx.js
+src/css/curCSS.js
+src/css/addGetHookIf.js
+src/css/support.js
+src/css/swap.js
+src/css.js
+src/effects/Tween.js
+src/effects.js
+src/queue/delay.js
+src/attributes/support.js
+src/attributes/val.js
+src/attributes/attr.js
+src/attributes/prop.js
+src/attributes/classes.js
+src/attributes.js
+src/event/alias.js
+src/ajax/var/nonce.js
+src/ajax/var/rquery.js
+src/ajax/parseJSON.js
+src/ajax/parseXML.js
+src/ajax.js
+src/manipulation/_evalUrl.js
+src/wrap.js
+src/css/hiddenVisibleSelectors.js
+src/serialize.js
+src/ajax/xhr.js
+src/ajax/script.js
+src/ajax/jsonp.js
+src/core/parseHTML.js
+src/ajax/load.js
+src/event/ajax.js
+src/effects/animatedSelector.js
+src/offset.js
+src/dimensions.js
+src/deprecated.js
+src/exports/amd.js
+src/exports/global.js
+src/jquery.js
diff --git a/debian/build.js b/debian/build.js
new file mode 100644
index 0000000..83e6a41
--- /dev/null
+++ b/debian/build.js
@@ -0,0 +1,60 @@
+var fs = require("fs");
+var path = require('path');
+
+var rdefineEnd = /\}\);[^}\w]*$/;
+
+/* this function was copied from build/tasks/build.js */
+function convert(name, path, contents) {
+		if ( /.\/var\//.test( path ) ) {
+			contents = contents
+				.replace( /define\([\w\W]*?return/, "var " + (/var\/([\w-]+)/.exec(name)[1]) + " =" )
+				.replace( rdefineEnd, "" );
+
+		// Sizzle treatment
+		} else if ( /^sizzle$/.test( name ) ) {
+			contents = "var Sizzle =\n" + contents
+				// Remove EXPOSE lines from Sizzle
+				.replace( /\/\/\s*EXPOSE[\w\W]*\/\/\s*EXPOSE/, "return Sizzle;" );
+
+		} else {
+
+			// Ignore jQuery's exports (the only necessary one)
+			if ( name !== "jquery" ) {
+				contents = contents
+					.replace( /\s*return\s+[^\}]+(\}\);[^\w\}]*)$/, "$1" )
+					// Multiple exports
+					.replace( /\s*exports\.\w+\s*=\s*\w+;/g, "" );
+			}
+
+			// Remove define wrappers, closure ends, and empty declarations
+			contents = contents
+				.replace( /define\([^{]*?{/, "" )
+				.replace( rdefineEnd, "" );
+
+			// Remove anything wrapped with
+			// /* ExcludeStart */ /* ExcludeEnd */
+			// or a single line directly after a // BuildExclude comment
+			contents = contents
+				.replace( /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig, "" )
+				.replace( /\/\/\s*BuildExclude\n\r?[\w\W]*?\n\r?/ig, "" );
+
+			// Remove empty definitions
+			contents = contents
+				.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
+		}
+
+    return contents;
+}
+
+process.argv.forEach(function (val, index, array) {
+  if (index <= 1) { return; }
+  var name = val
+	.replace(/^src\/sizzle\/dist\//, '')
+	.replace(/^src\//, '')
+	.replace(/\.js$/, '');
+  var contents = fs.readFileSync(val, { encoding: 'utf8' });
+  var contents = convert(name, val, contents);
+  console.log(contents);
+});
+
+
diff --git a/debian/build.mk b/debian/build.mk
new file mode 100644
index 0000000..5e2e95c
--- /dev/null
+++ b/debian/build.mk
@@ -0,0 +1,20 @@
+source = $(shell grep -v '^\s*\#' debian/build-$(version).txt)
+timestamp = $(shell date --iso-8601=minutes --utc --date=$(SOURCE_DATE_EPOCH))
+version = $(shell dpkg-parsechangelog -SVersion | cut -d + -f 1)
+
+install: dist/jquery.js dist/jquery.min.js dist/jquery.min.map
+
+dist/jquery.js: src/intro.js $(source) src/outro.js
+	mkdir -p $(shell dirname $@)
+	nodejs debian/build.js $^ > $@.in
+	sed -e 's/@DATE/$(timestamp)/; s/@VERSION/$(version)/' $@.in > $@ || ($(RM) $@; false)
+
+dist/jquery.min.js dist/jquery.min.map: dist/jquery.js
+	uglifyjs \
+		--source-map dist/jquery.min.map \
+		--source-map-url jquery.min.map \
+		--output dist/jquery.min.js \
+		$^
+
+clean:
+	$(RM) -rf dist/
diff --git a/debian/changelog b/debian/changelog
index ec82b00..f491e87 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,13 @@ jquery (1.11.3+dfsg-1) UNRELEASED; urgency=medium
 
   * New upstream release
   * drop debian/patches: only patch in there does not apply anymore
+  * Added locally-hacked build system:
+    - debian/build.mk (called from debian/rules)
+    - debian/build.js (called from debian/build.mk)
+    - debian/build-1.11.3.txt (used as input by debian/build.mk)
+    .
+    This reproduces the build that you would get with grunt, modulo comment
+    lines and empty lines, which go away when the file is minified anyway.
   * debian/watch: point at github
   * Add myself to Uploaders:
   * debian/copyright: list dist/ in Files-Excluded:
diff --git a/debian/control b/debian/control
index 36ff00f..873ed91 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: web
 Priority: optional
 Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
 Uploaders: Marcelo Jorge Vieira (metal) <metal at debian.org>, Steve Kemp <skx at debian.org>, Antonio Terceiro <terceiro at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), node-uglify
+Build-Depends: debhelper (>= 7.0.50~), node-uglify, node-source-map
 Standards-Version: 3.9.4
 Homepage: http://jquery.com/
 Vcs-Browser: http://git.debian.org/?p=pkg-javascript/jquery.git
diff --git a/debian/install b/debian/install
index 5a2e6a6..68854f7 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1 @@
 dist/*.js		/usr/share/javascript/jquery
-version.txt		/usr/share/javascript/jquery
diff --git a/debian/rules b/debian/rules
index a5bfe92..f36079e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,14 +1,14 @@
 #!/usr/bin/make -f
-build %:
-	dh $@
 
-override_dh_auto_clean:
-	rm -rf dist/
-	dh_clean
+export MAKE = make -f debian/build.mk
 
-override_dh_clean:
-	rm -rf dist/
-	rm build/.sizecache.json
-	dh_clean
+override_dh_auto_build:
+	make -f debian/build.mk
+	dh_auto_build
 
-.PHONY: build
+override_dh_auto_clean:
+	make -f debian/build.mk clean
+	dh_auto_clean
+
+%:
+	dh $@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jquery.git



More information about the Pkg-javascript-commits mailing list