Igor Vaynberg 13 vuotta sitten
vanhempi
commit
af6031039a
4 muutettua tiedostoa jossa 91 lisäystä ja 14 poistoa
  1. 10 14
      LICENSE
  2. 76 0
      release.sh
  3. 3 0
      select2.css
  4. 2 0
      select2.js

+ 10 - 14
LICENSE

@@ -1,16 +1,12 @@
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
+Copyright 2012 Igor Vaynberg
+ 
+Version: @@ver@@ Timestamp: @@timestamp@@
 
-  http://www.apache.org/licenses/LICENSE-2.0
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in
+compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
 
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed under the License is
+distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and limitations under the License.

+ 76 - 0
release.sh

@@ -0,0 +1,76 @@
+#!/bin/bash
+set -e
+
+echo -n "Enter the version for this release: "
+
+read ver
+
+if [ ! $ver ]; then 
+	echo "Invalid version."
+	exit
+fi
+
+name=select2
+js="$name.js"
+mini="$name.min.js"
+css="$name.css"
+release="$name-$ver"
+tag="release-$ver"
+branch="build-$ver"
+curbranch=`git branch | grep "*" | sed "s/* //"`
+timestamp=$(date)
+tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g"
+remote="github"
+
+git branch "$branch"
+git checkout "$branch"
+
+echo "Tokenizing..."
+
+find . -name "$js" | xargs sed -i -e "$tokens"
+find . -name "$css" | xargs sed -i -e "$tokens"
+
+git add "$js"
+git add "$css"
+
+echo "Minifying..."
+
+echo "/*" > "$mini"
+cat LICENSE | sed "$tokens" >> "$mini"
+echo "*/" >> "$mini"
+
+curl -s \
+	-d compilation_level=SIMPLE_OPTIMIZATIONS \
+	-d output_format=text \
+	-d output_info=compiled_code \
+	--data-urlencode "js_code@$js" \
+	http://closure-compiler.appspot.com/compile \
+	>> "$mini"
+
+git add "$mini"
+	
+git commit -m "release $ver"
+
+echo "Tagging..."
+
+git tag -a "$tag" -m "tagged version $ver"
+git push "$remote" --tags
+
+echo "Archiving..."
+
+rm -rf "$release"
+mkdir "$release"
+
+cp $name.* "$release"
+cp spinner.gif "$release"
+cp README.* "$release"
+
+zip -r "$release.zip" "$release"
+rm -rf "$release"
+
+echo "Cleaning Up..."
+
+git checkout "$curbranch"
+git branch -D "$branch"
+
+echo "Done"

+ 3 - 0
select2.css

@@ -1,3 +1,6 @@
+/*
+Version: @@ver@@ Timestamp: @@timestamp@@
+*/
 .select2-container {
     position: relative;
     display: inline-block;

+ 2 - 0
select2.js

@@ -1,5 +1,7 @@
 /*
  Copyright 2012 Igor Vaynberg
+ 
+ Version: @@ver@@ Timestamp: @@timestamp@@
 
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in
  compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: