瀏覽代碼

Change the way the extra info appears

OpenShift guest 11 年之前
父節點
當前提交
daeac82fda
共有 2 個文件被更改,包括 10 次插入8 次删除
  1. 4 3
      utils/build/build.js
  2. 6 5
      utils/build/build.py

+ 4 - 3
utils/build/build.js

@@ -34,6 +34,9 @@ function main() {
 
 	var buffer = [];
 	var sources = [];
+		
+	buffer.push('// You shouldn\'t edit this build file. \n');
+	buffer.push('// The following source code is build from the src folder. \n');
 	
 	if ( args.amd ){
 		buffer.push('function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n');
@@ -49,9 +52,7 @@ function main() {
 			var file = '../../' + files[ j ];
 			
 			sources.push( file );
-			buffer.push('// You shouldn\'t edit this build file. \n');
-			buffer.push('// The following source code should be edited in \n');
-			buffer.push('// ' + files[ j ]);
+			buffer.push('// File:' + files[ j ]);
 			buffer.push('\n\n');
 			buffer.push( fs.readFileSync( file, 'utf8' ) );
 			buffer.push('\n');

+ 6 - 5
utils/build/build.py

@@ -5,7 +5,7 @@ import sys
 if sys.version_info < (2, 7):
 	print("This script requires at least Python 2.7.")
 	print("Please, update to a newer version: http://www.python.org/download/releases/")
-	exit()
+#	exit()
 
 import argparse
 import json
@@ -44,7 +44,10 @@ def main(argv=None):
 	fd, path = tempfile.mkstemp()
 	tmp = open(path, 'w')
 	sources = []
-
+	
+	tmp.write('// You shouldn\'t edit this build file. \n')
+	tmp.write('// The following source code is build from the src folder. \n')
+	
 	if args.amd:
 		tmp.write('( function ( root, factory ) {\n\n\tif ( typeof define === \'function\' && define.amd ) {\n\n\t\tdefine( [ \'exports\' ], factory );\n\n\t} else if ( typeof exports === \'object\' ) {\n\n\t\tfactory( exports );\n\n\t} else {\n\n\t\tfactory( root );\n\n\t}\n\n}( this, function ( exports ) {\n\n')
 
@@ -52,9 +55,7 @@ def main(argv=None):
 		with open('includes/' + include + '.json','r') as f:
 			files = json.load(f)
 		for filename in files:
-			tmp.write('// You shouldn\'t edit this build file. \n')
-			tmp.write('// The following source code should be edited in \n')
-			tmp.write('// ' + filename)
+			tmp.write('// File:' + filename)
 			tmp.write('\n\n')
 			filename = '../../' + filename;
 			sources.append(filename)