]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Add license header to all *.min.js files.
authorDavid Humphrey <david.humphrey@senecac.on.ca>
Wed, 20 Apr 2011 16:56:40 +0000 (12:56 -0400)
committerDavid Humphrey <david.humphrey@senecac.on.ca>
Wed, 20 Apr 2011 16:56:40 +0000 (12:56 -0400)
LICENSE_HEADER [new file with mode: 0644]
Makefile
popcorn.js

diff --git a/LICENSE_HEADER b/LICENSE_HEADER
new file mode 100644 (file)
index 0000000..06764a6
--- /dev/null
@@ -0,0 +1,8 @@
+/*
+ * popcorn.js version @VERSION
+ * http://popcornjs.org
+ *
+ * Copyright 2011, Mozilla Foundation
+ * Licensed under the MIT license
+ */
+
index 73f111bf3bf0f1f0cf91e9add734107844eabefa..2b5fe8a90ab42d8243f294f292b7781a5ecdf4b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,9 @@ POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} \
 POPCORN_COMPLETE_DIST = ${DIST_DIR}/popcorn-complete.js
 POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js
 
+# Create a versioned license header for js files we ship: arg1=source arg2=dest
+add_license = cat ${PREFIX}/LICENSE_HEADER | sed -e 's/@VERSION/${VERSION}/' > $(2) ; \
+                           cat $(1) >> $(2)
 
 all: lint lint-plugins lint-parsers lint-players popcorn plugins parsers players complete min
        @@echo "Popcorn build complete."
@@ -66,23 +69,28 @@ popcorn: ${POPCORN_DIST}
 
 ${POPCORN_DIST}: ${POPCORN_SRC} | ${DIST_DIR}
        @@echo "Building" ${POPCORN_DIST}
-       @@cat ${POPCORN_SRC} | sed -e 's/@VERSION/${VERSION}/' > ${POPCORN_DIST}
+       @@$(call add_license, $(POPCORN_SRC), $(POPCORN_DIST))
+#      @@cat ${POPCORN_SRC} | sed -e 's/@VERSION/${VERSION}/' > ${POPCORN_DIST}
 
 min: ${POPCORN_MIN} ${PLUGINS_MIN} ${PARSERS_MIN} ${PLAYERS_MIN} ${POPCORN_COMPLETE_MIN}
 
 ${POPCORN_MIN}: ${POPCORN_DIST}
        @@echo "Building" ${POPCORN_MIN}
-       $(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN})
+       @@$(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN}.tmp)
+       @@$(call add_license, ${POPCORN_MIN}.tmp, ${POPCORN_MIN})
+       @@rm ${POPCORN_MIN}.tmp
 
 ${POPCORN_COMPLETE_MIN}: ${POPCORN_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} ${DIST_DIR}
        @@echo "Building" ${POPCORN_COMPLETE_MIN}
-       @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN})
+       @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN}.tmp)
+       @@$(call add_license, ${POPCORN_COMPLETE_MIN}.tmp, ${POPCORN_COMPLETE_MIN})
+       @@rm ${POPCORN_COMPLETE_MIN}.tmp
 
 plugins: ${PLUGINS_DIST}
 
 ${PLUGINS_MIN}: ${PLUGINS_DIST}
        @@echo "Building" ${PLUGINS_MIN}
-       $(call compile, $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done), ${PLUGINS_MIN})
+       @@$(call compile, $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done), ${PLUGINS_MIN})
 
 ${PLUGINS_DIST}: ${PLUGINS_SRC} ${DIST_DIR}
        @@echo "Building ${PLUGINS_DIST}"
@@ -92,7 +100,7 @@ parsers: ${PARSERS_DIST}
 
 ${PARSERS_MIN}: ${PARSERS_DIST}
        @@echo "Building" ${PARSERS_MIN}
-       $(call compile, $(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done), ${PARSERS_MIN})
+       @@$(call compile, $(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done), ${PARSERS_MIN})
 
 ${PARSERS_DIST}: ${PARSERS_SRC} ${DIST_DIR}
        @@echo "Building ${PARSERS_DIST}"
@@ -102,7 +110,7 @@ players: ${PLAYERS_DIST}
 
 ${PLAYERS_MIN}: ${PLAYERS_DIST}
        @@echo "Building" ${PLAYERS_MIN}
-       $(call compile, $(shell for js in ${PLAYERS_SRC} ; do echo --js $$js ; done), ${PLAYERS_MIN})
+       @@$(call compile, $(shell for js in ${PLAYERS_SRC} ; do echo --js $$js ; done), ${PLAYERS_MIN})
 
 ${PLAYERS_DIST}: ${PLAYERS_SRC} ${DIST_DIR}
        @@echo "Building ${PLAYERS_DIST}"
index 0372d8f56d16e0a58948a4e23db5b8f5361b9a7b..6555f625a774aae4da9723163e8add1f397d2d2f 100644 (file)
@@ -1,11 +1,3 @@
-/*
- * popcorn.js version @VERSION
- * http://popcornjs.org
- *
- * Copyright 2011, Mozilla Foundation
- * Licensed under the MIT license
- */
-
 (function(global, document) {
 
   //  Cache refs to speed up calls to native utils