Skip to content

Commit

Permalink
Add xqlint as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Feb 16, 2013
1 parent c61cd9f commit e2c698f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "support/xqlint"]
path = support/xqlint
url = git://github.com/wcandillon/xqlint.git
10 changes: 10 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
appDir: "./js",
baseUrl: "."
name: "main.js",
out: "./xqlint.js",
//dir: "build/xqlint",
paths: {
"xqlint": "support/xqlint/lib"
}
}
26 changes: 23 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
<property name="templates.dir" value="./templates"/>
<property name="templates.default.dir" value="${templates.dir}/default"/>
<property name="closure.compiler.url" value="http://closure-compiler.googlecode.com/files/compiler-latest.zip"/>
<property name="rhino.url" value="https://github.com/jrburke/r.js/blob/master/lib/rhino/js.jar?raw=true"/>
<property name="rhino.jar" value="tools/js.jar"/>
<property name="r.js.url" value="http://requirejs.org/docs/release/2.1.4/r.js"/>
<property name="server.url" value="http://demo.exist-db.org/exist/apps/public-repo/public/"/>
<available property="closure.available" file="${tools}/compiler.jar"/>
<available property="rhino.available" file="${tools}/js.jar"/>
<target name="get-closure" unless="closure.available">
<echo message="Downloading closure..."/>
<mkdir dir="${tools}"/>
<get src="${closure.compiler.url}" dest="${tools}"/>
<unzip dest="${tools}">
Expand All @@ -21,11 +26,18 @@
</unzip>
<delete file="${tools}/compiler-latest.zip"/>
</target>
<target name="prepare" depends="get-closure">
<target name="get-rhino" unless="rhino.available">
<echo message="Downloading rhino..."/>
<mkdir dir="${tools}"/>
<get src="${rhino.url}" dest="${tools}"/>
<get src="${r.js.url}" dest="${tools}"/>
</target>
<target name="prepare" depends="get-closure,get-rhino">
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="${tools}/compiler.jar"/>
</target>
<target name="all" depends="compress,xar"/>
<target name="all" depends="xqlint,compress,xar"/>
<target name="compress" depends="prepare">
<echo message="Optimizing eXide sources"/>
<jscomp compilationLevel="simple" debug="false" output="${scripts}/eXide.min.js">
<sources dir="${basedir}/src">
<file name="util.js"/>
Expand Down Expand Up @@ -66,13 +78,21 @@
</sources>
</jscomp>
</target>
<target name="xqlint" depends="get-rhino">
<echo message="Optimizing xqlint ..."/>
<java classpath="${rhino.jar}:${tools}/compiler.jar" classname="org.mozilla.javascript.tools.shell.Main">
<arg line="tools/r.js"/>
<arg line="-o tools/build.js"/>
</java>
</target>
<target name="clean">
<delete>
<fileset dir="${scripts}">
<include name="eXide-*.min.js"/>
</fileset>
</delete>
<delete file="${scripts}/jquery/jquery.plugins.min.js"/>
<delete file="${scripts}/xqlint.min.js"/>
</target>
<target name="xar">
<mkdir dir="${build}"/>
Expand All @@ -82,7 +102,7 @@
<include name="modules/**"/>
<include name="resources/**"/>
<include name="templates/**"/>
<exclude name="src/**"/>
<include name="src/**"/>
<exclude name=".git*"/>
</fileset>
</zip>
Expand Down
1 change: 1 addition & 0 deletions support/xqlint
Submodule xqlint added at c1eabb
8 changes: 8 additions & 0 deletions tools/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
name: "main/main",
out: "../resources/scripts/xqlint.min.js",
paths: {
"xqlint": "../support/xqlint/lib"
},
optimize: "closure"
}
3 changes: 3 additions & 0 deletions tools/main/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require(["xqlint/Translator", "xqlint/Compiler", "xqlint/XQueryParser", "xqlint/XQueryLexer", "xqlint/JSONParseTreeHandler", "xqlint/visitors/CodeFormatter",
"xqlint/visitors/SemanticHighlighter"], function (one, two, three) {
});

0 comments on commit e2c698f

Please sign in to comment.