Permalink
Browse files

First commit

  • Loading branch information...
1 parent 17f9872 commit dc2532047312cca0273de4683a0c8664fe9d39bc Nicholas C. Zakas committed Dec 15, 2011
View
@@ -1,40 +1 @@
-CSSEmbed
-Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
-0.3.6
- * Allow specification of maximum data URI length (tivac and fearphage)
- * Option to skip files that are missing (tivac)
-
-0.3.5
- * Allow input from STDIN.
-
-0.3.4
-
- * Don't include data URIs if they're longer than 32KB (for IE8 support).
- * Accept input from stdin.
-
-0.3.2
-
- * Brought DataURI into the same repo.
- * Added warning when data URI is larger than 32KB (for IE8 support)
- * Fixed bug where non-image URIs weren't being handled correctly in MHTML output.
-
-0.3.1
-
- * Cleaned up MHTML support.
-
-0.3.0
-
- * Initial MHTML support based on dchaplinsky's patch.
- http://github.com/nzakas/cssembed/issues/#issue/3,
- "MHTML support (patch inside)"
-
-0.2.7
-
- * Added dchaplinsky's patch for warning about duplicate images.
- * Fixed http://github.com/nzakas/cssembed/issues/#issue/5,
- "Specifying the same input and output results in empty file".
-
-0.2.6
-
- * First public release.
View
31 LICENSE
@@ -0,0 +1,31 @@
+Props2Js
+Copyright (c) 2011 Nicholas C. Zakas. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+This software also requires access to software from the following sources:
+
+The Jargs Library v1.0 (http://jargs.sourceforge.net/) is available
+under a BSD License. Copyright (c) 2001-2003 Steve Purcell,
+Copyright (c) 2002 Vidar Holen, Copyright (c) 2002 Michal Ceresna and
+Copyright (c) 2005 Ewan Mellor.
+
+The Gson Library v2.0 (http://code.google.com/p/google-gson/) is available
+under an Apache License (http://www.apache.org/licenses/LICENSE-2.0).
+Copyright 2008-2011 Google Inc.
View
74 README
@@ -1,31 +1,43 @@
-CSSEmbed
-Copyright (c) 2009 Nicholas C. Zakas. All rights reserved.
-
--------------------------------------------------------------------------------
- About
--------------------------------------------------------------------------------
-
-CSSEmbed is a small program/library to automate embedding of data URIs in
-CSS files.
-
--------------------------------------------------------------------------------
- License
--------------------------------------------------------------------------------
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+# Props2Js
+
+Props2Js is a command line utility that converts Java properties files into one
+of three different formats:
+
+1. JSON
+1. JSONP
+1. JavaScript
+
+The goal is to allow you to easily store configuration data that is needed for
+JavaScript in a simple format and then transform it into a format you need in
+your application.
+
+## Formats
+
+### JSON Format
+
+To convert a properties file into JSON, use the following
+
+ java -jar props2js-x.y.z.jar source.properties -t json -o output.json
+
+This reads in the properties file `source.properties` and outputs the JSON
+equivalent into `output.json`.
+
+### JSONP Format
+
+To convert a properties file into JSON, use the following
+
+ java -jar props2js-x.y.z.jar source.properties -t jsonp --name myfunc -o output.jsonp
+
+This reads in the properties file `source.properties` and outputs the JSONP
+equivalent into `output.jsonp`. This is the same as outputting as JSON except
+`myfunc()` is wrapped around the data.
+
+### JavaScript Format
+
+To convert a properties file into JavaScript, use the following
+
+ java -jar props2js-x.y.z.jar source.properties -t js --name myvar -o output.js
+
+This reads in the properties file `source.properties` and outputs the JavaScript
+equivalent into `output.js`. This is the same as outputting as JSON except
+`var myvar=` precedes the JSON and a semicolon follows it.
View
@@ -8,19 +8,13 @@ res.dir = res
#Lib jars
jargs.jar = jargs-1.0.jar
junit.jar = junit-4.1.jar
-ant.jar = ant.jar
+gson.jar = gson-2.0.jar
#Global properties
class.version = 1.5
-#CSSEmbed properties
-cssembed.name = cssembed
-cssembed.version = 0.4.0
-cssembed.jar = ${cssembed.name}-${cssembed.version}.jar
-cssembed.main = net.nczonline.web.cssembed.CSSEmbed
-
-#DataURI properties
-datauri.name = datauri
-datauri.version = 0.2.2
-datauri.jar = ${datauri.name}-${datauri.version}.jar
-datauri.main = net.nczonline.web.datauri.DataURI
+#props2js properties
+props2js.name = props2js
+props2js.version = 0.1.0
+props2js.jar = ${props2js.name}-${props2js.version}.jar
+props2js.main = net.nczonline.web.props2js.Props2Js
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<project name="CSSEmbed" default="build.all.jars" basedir=".">
+<project name="props2js" default="build.jar" basedir=".">
<target name="clean" depends="-load.properties">
<delete dir="${build.dir}" quiet="true"/>
@@ -23,9 +23,8 @@
source="${class.version}"
target="${class.version}">
<classpath>
- <pathelement location="${lib.dir}/${ant.jar}"/>
<pathelement location="${lib.dir}/${jargs.jar}"/>
- <pathelement location="${lib.dir}/${datauri.jar}"/>
+ <pathelement location="${lib.dir}/${gson.jar}"/>
</classpath>
</javac>
</target>
@@ -40,57 +39,26 @@
source="${class.version}"
target="${class.version}">
<classpath>
- <pathelement location="${lib.dir}/${ant.jar}"/>
+ <pathelement location="${lib.dir}/${gson.jar}"/>
<pathelement location="${lib.dir}/${jargs.jar}"/>
<pathelement location="${lib.dir}/${junit.jar}"/>
<pathelement location="${build.dir}/classes"/>
</classpath>
</javac>
- <copy todir="${build.dir}/testclasses/net/nczonline/web/cssembed">
+ <copy todir="${build.dir}/testclasses/net/nczonline/web/props2js">
<fileset dir="${tests.dir}" includes="*.png"/>
<fileset dir="${tests.dir}" includes="*.css"/>
</copy>
</target>
- <target name="build.cssembed.jar" depends="build.classes">
- <make-jar name="${cssembed.name}" jar="${cssembed.jar}" main="${cssembed.main}">
+ <target name="build.jar" depends="build.classes">
+ <make-jar name="${props2js.name}" jar="${props2js.jar}" main="${props2js.main}">
<jar-files>
<fileset dir="${build.dir}/classes" includes="**/*.class"/>
</jar-files>
</make-jar>
</target>
-
- <target name="build.datauri.jar" depends="build.classes">
- <make-jar name="${datauri.name}" jar="${datauri.jar}" main="${datauri.main}">
- <jar-files>
- <fileset dir="${build.dir}/classes" includes="**/datauri/*.class"/>
- </jar-files>
- </make-jar>
- </target>
-
- <!-- build all jars -->
- <target name="build.all.jars" depends="clean,build.cssembed.jar,build.datauri.jar"></target>
-
-
- <target name="build.dist.package" depends="build.cssembed.jar,build.datauri.jar">
- <mkdir dir="${build.dir}/${dist.package.name}"/>
- <mkdir dir="${build.dir}/${dist.package.name}/build"/>
- <copy file="${build.dir}/${jar.name}" todir="${build.dir}/${dist.package.name}/build"/>
- <copy todir="${build.dir}/${dist.package.name}">
- <fileset dir=".">
- <include name="ant.properties"/>
- <include name="build.xml"/>
- <include name="doc/**/*"/>
- <include name="lib/**/*"/>
- <include name="src/**/*"/>
- <exclude name="**/.git"/>
- </fileset>
- </copy>
- <zip destfile="${build.dir}/${dist.package.name}.zip"
- basedir="${build.dir}"
- includes="${dist.package.name}/**/*"/>
- </target>
<target name="test.classes" depends="build.classes,build.tests">
<junit printsummary="yes" fork="yes" errorproperty="junit.failure" failureproperty="junit.failure" showoutput="true">
@@ -101,7 +69,7 @@
<classpath>
<pathelement location="${build.dir}/classes"/>
<pathelement location="${build.dir}/testclasses"/>
- <pathelement location="${lib.dir}/${datauri.jar}"/>
+ <pathelement location="${lib.dir}/${gson.jar}"/>
<pathelement location="${lib.dir}/${junit.jar}"/>
</classpath>
@@ -126,6 +94,7 @@
<sequential>
<mkdir dir="${build.dir}/@{name}-jar"/>
<unjar src="${lib.dir}/${jargs.jar}" dest="${build.dir}/@{name}-jar"/>
+ <unjar src="${lib.dir}/${gson.jar}" dest="${build.dir}/@{name}-jar"/>
<copy todir="${build.dir}/@{name}-jar">
<jar-files/>
</copy>
Oops, something went wrong.

0 comments on commit dc25320

Please sign in to comment.