Skip to content

Commit

Permalink
Misc release work
Browse files Browse the repository at this point in the history
  • Loading branch information
dmester committed Nov 27, 2014
1 parent e204268 commit 5234b20
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 13 deletions.
6 changes: 3 additions & 3 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ del /Q ~stringformat.nuspec
rem obj files
del /Q out.~js

copy /Y stringformat.js obj\stringformat.js
copy /Y stringformat.js obj\stringformat-%version%.js
copy /Y stringformat.tests.js obj\
copy /Y license.txt obj\
copy /Y readme.txt obj\
Expand All @@ -25,7 +25,7 @@ xcopy /D /Y cultures\*.* obj\cultures\
utils\compiler.jar --js=stringformat.js --js_output_file=out.~js

rem Append header
copy /B header.txt + out.~js obj\stringformat.min.js
copy /B header.txt + out.~js obj\stringformat-%version%.min.js

rem Timestamp
utils\DateTimeFormat --utc --format "yyyy-MM-ddTHH:mm:ssZ" > date.~tmp
Expand All @@ -37,7 +37,7 @@ del date.~tmp
copy stringformat.nuspec ~stringformat.nuspec

rem Replace version
utils\replace "{version}=%version%" "{date}=%date%" "{year}=%year%" obj\stringformat.js obj\stringformat.min.js obj\readme.txt obj\license.txt ~stringformat.nuspec
utils\replace "{version}=%version%" "{date}=%date%" "{year}=%year%" obj\stringformat-%version%.js obj\stringformat-%version%.min.js obj\stringformat.tests.js obj\readme.txt obj\license.txt obj\tests.html ~stringformat.nuspec

rem Create NuGet Package
utils\NuGet.exe pack ~stringformat.nuspec -OutputDirectory releases
Expand Down
4 changes: 2 additions & 2 deletions license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
String.format for JavaScript
Copyright (c) 2009-{year} Daniel Mester Pirttijärvi

The library core (stringformat.js and stringformat.src.js) is licensed
under the terms of the zlib license.
The library core (stringformat-{version}.js and stringformat-{version}.min.js) is
licensed under the terms of the zlib license.

* * *

Expand Down
10 changes: 5 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ FILES

You got a number of files when you extracted the script library:

stringformat.js - Compressed and obfuscated, to be used in production.
stringformat.src.js - Commented source file for your reference.
stringformat-{version}.min.js - Compressed and obfuscated, to be used in production.
stringformat-{version}.js - Commented source file for your reference.
tests.html - Test page that performs unit tests on the library.
stringformat.tests.js - Script for tests.html.
cultures/stringformat.XX.js - Files holding metadata about cultures.
Expand All @@ -32,9 +32,9 @@ are targetting. Note that if no culture files are included, the invariant
culture will be used.

[CODE]
<script type="text/javascript" src="stringformat.js"></script>
<script type="text/javascript" src="stringformat.en.js"></script>
<script type="text/javascript" src="stringformat.sv.js"></script>
<script type="text/javascript" src="stringformat-{version}.min.js"></script>
<script type="text/javascript" src="cultures/stringformat.en.js"></script>
<script type="text/javascript" src="cultures/stringformat.sv.js"></script>

Then you're ready to go. Here are two simple examples using indexes and object
paths/named parameters.
Expand Down
4 changes: 2 additions & 2 deletions stringformat.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ Currently the script takes less than 5 kB, excluding additional localizations. T
<file src="obj\cultures\stringformat.zh.js" target="Content\Scripts\cultures\stringformat.zh.js" />
<file src="obj\cultures\stringformat.zu-ZA.js" target="Content\Scripts\cultures\stringformat.zu-ZA.js" />
<file src="obj\cultures\stringformat.zu.js" target="Content\Scripts\cultures\stringformat.zu.js" />
<file src="obj\stringformat.min.js" target="Content\Scripts\stringformat-{version}.min.js" />
<file src="obj\stringformat.js" target="Content\Scripts\stringformat-{version}.js" />
<file src="obj\stringformat-{version}.min.js" target="Content\Scripts\stringformat-{version}.min.js" />
<file src="obj\stringformat-{version}.js" target="Content\Scripts\stringformat-{version}.js" />
<file src="obj\readme.txt" target="Content\Scripts\stringformat.readme.txt" />
</files>
</package>
30 changes: 29 additions & 1 deletion stringformat.tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@

/**
* Unit tests for
* String.format for JavaScript {version}
* mstr.se/sffjs
*
* Built: {date}
*
* Copyright (c) 2009-{year} Daniel Mester Pirttijärvi
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
*/

(function () {
/// <summary>
/// Performs a series of unit tests and writes the output to the page.
Expand Down
29 changes: 29 additions & 0 deletions tests.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Unit tests for
String.format for JavaScript {version}
mstr.se/sffjs
Built: {date}
Copyright (c) 2009-{year} Daniel Mester Pirttijärvi
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
-->
<html>
<head>
<title>Unit testning String.format for JavaScript</title>
Expand Down Expand Up @@ -97,6 +125,7 @@
<body>

<script type="text/javascript" src="stringformat.js"></script>
<script type="text/javascript" src="stringformat-{version}.min.js"></script>
<script type="text/javascript" src="cultures/stringformat.en-US.js"></script>
<script type="text/javascript" src="cultures/stringformat.sv.js"></script>
<script type="text/javascript" src="stringformat.tests.js"></script>
Expand Down

0 comments on commit 5234b20

Please sign in to comment.