Skip to content

Commit 95de5a8

Browse files
author
Jeremy White
committed
Added tool to help with distribution
1 parent 0492f72 commit 95de5a8

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

tools/license_header.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// Connect SDK JavaScript Bridge
3+
//
4+
// Created by Jeremy White on 12/2/13.
5+
// Copyright (c) 2014 LG Electronics.
6+
//
7+
// Licensed under the Apache License, Version 2.0 (the "License");
8+
// you may not use this file except in compliance with the License.
9+
// You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing, software
14+
// distributed under the License is distributed on an "AS IS" BASIS,
15+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
// See the License for the specific language governing permissions and
17+
// limitations under the License.
18+
//

tools/minify.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
# Usage:
4+
# 1. npm install -g minifier
5+
# 2. chmod a+x ./tools/minify.sh
6+
# 3. ./tools/minify.sh
7+
8+
# copy uncompressed JS file and apply header
9+
cat ./license_header.txt > ../dist/connect_bridge.js
10+
cat ../src/connect_bridge.js >> ../dist/connect_bridge.js
11+
12+
# set up minified JS file with header
13+
cat ./license_header.txt > ../dist/connect_bridge.min.js
14+
15+
# minify JS file to tmp location
16+
minify --output /tmp/connect_bridge.min.js ../src/connect_bridge.js
17+
18+
# copy minified JS file contents to min file
19+
cat /tmp/connect_bridge.min.js >> ../dist/connect_bridge.min.js
20+
21+
# cleanup
22+
rm /tmp/connect_bridge.min.js

0 commit comments

Comments
 (0)