Skip to content
This repository
Browse code

added simpler versioning

  • Loading branch information...
commit 6b60bd13f96ca0d716d6d0cf022c02372eb26b63 1 parent 47f740f
Fil Maj authored July 25, 2011
9  build
@@ -3,8 +3,7 @@ require 'YAML'
3 3
 require 'fileutils'
4 4
 
5 5
 PROFILE_PATH = "util/profiles"
6  
-
7  
-# TODO: print out build command line if no args provided.
  6
+version = open("VERSION").read.rstrip
8 7
 
9 8
 def show_usage
10 9
   STDERR.puts "\nusage: ./build [ profile=<name> ] [ --minify ] [ --generate-docs ]"
@@ -37,7 +36,7 @@ end
37 36
 hash = YAML.load_file(File.join(PROFILE_PATH, profile) + ".js")
38 37
 
39 38
 # clear previous file
40  
-target = hash["out"]
  39
+target = hash["out"] + "-" + version + ".js"
41 40
 target_dir = File.dirname(target)
42 41
 
43 42
 Dir.mkdir(target_dir) unless File.directory?(target_dir)
@@ -52,8 +51,8 @@ if extra
52 51
 end
53 52
 
54 53
 if minify
55  
-  minified_filename = hash['out'].sub(/\.js$/, '.min.js')
56  
-  `java -jar util/compiler.jar --js=#{ hash["out"] } \
  54
+  minified_filename = target.sub(/\.js$/, '.min.js')
  55
+  `java -jar util/compiler.jar --js=#{ target } \
57 56
   --js_output_file=#{ minified_filename }`
58 57
 end
59 58
 
2  util/profiles/bb.js
... ...
@@ -1,5 +1,5 @@
1 1
 {
2  
-    out: "lib/xui-bb-2.2.0.js",
  2
+    out: "lib/xui-bb",
3 3
     include: [
4 4
         "src/header",
5 5
         "src/base",
2  util/profiles/core.js
... ...
@@ -1,5 +1,5 @@
1 1
 {
2  
-    out: "lib/xui-2.2.0.js",
  2
+    out: "lib/xui",
3 3
     include: [
4 4
         "src/header",
5 5
         "src/base",
2  util/profiles/ie.js
... ...
@@ -1,5 +1,5 @@
1 1
 {
2  
-    out: "lib/xui-ie-2.2.0.js",
  2
+    out: "lib/xui-ie",
3 3
     include: [
4 4
         "src/header",
5 5
         "src/base",

0 notes on commit 6b60bd1

Please sign in to comment.
Something went wrong with that request. Please try again.