Permalink
Browse files

Worked on source/build support

  • Loading branch information...
1 parent 77aa839 commit 0b66c229469325ad92710bea25fee2ed26e75e44 Sebastian Werner committed Mar 16, 2012
Showing with 34 additions and 11 deletions.
  1. +2 −0 .gitignore
  2. +1 −1 jasyproject.json
  3. +22 −7 jasyscript.py
  4. +5 −2 source/class/Main.js
  5. +4 −1 source/index.html
View
@@ -1 +1,3 @@
jasycache*
+build
+source/script
View
@@ -14,7 +14,7 @@
"qunit/qunit.js"
],
- "qunit.css" : [
+ "qunit-xyz.css" : [
"qunit/qunit.css"
]
}
View
@@ -1,20 +1,35 @@
#!/usr/bin/env jasy
+session = Session()
optimization = Optimization("blocks", "declarations", "variables", "privates")
formatting = Formatting()
-session = Session()
-
-@task("Writing Main")
-def main():
+@task("Build")
+def build():
+ buildFolder = "build"
+
resolver = Resolver(session.getProjects())
resolver.addClassName("compatty.Main")
asset = Asset(session, resolver.getIncludedClasses())
- kernelClasses = storeKernel("kernel.js", session, assets=asset.exportBuild())
+ kernelClasses = storeKernel("%s/script/kernel.js" % buildFolder, session, debug=True, assets=asset.exportBuild(buildFolder=buildFolder))
resolver.excludeClasses(kernelClasses)
classes = Sorter(resolver).getSortedClasses()
- storeCompressed("main.js", classes, formatting=formatting, optimization=optimization)
-
+ storeCompressed("%s/script/main.js" % buildFolder, classes, formatting=formatting, optimization=optimization)
+ copyFile("source/index.html", "build/index.html")
+
+
+@task("Source")
+def source():
+ resolver = Resolver(session.getProjects())
+ resolver.addClassName("compatty.Main")
+
+ asset = Asset(session, resolver.getIncludedClasses())
+ kernelClasses = storeKernel("source/script/kernel.js", session, debug=True, assets=asset.exportSource())
+
+ resolver.excludeClasses(kernelClasses)
+ classes = Sorter(resolver).getSortedClasses()
+
+ storeSourceLoader("source/script/main.js", classes, session)
View
@@ -1,14 +1,17 @@
/**
* Test for playing with 3rd party code
*
- * #asset(qunit.css)
+ * #asset(qunit-xyz.css)
*/
(function() {
- core.io.Asset.load(["qunit.css"], function() {
+ // Asset loading feature tests
+ // Use the name of the files you have defined in your jasyproject.conf
+ core.io.Asset.load(["qunit-xyz.css"], function() {
console.debug("QUnit style sheet loaded!");
});
+ // Testing existance of classes/modules
console.debug("Has QUnit Object:", !!QUnit);
console.debug("Has Slang Object:", !!slang);
console.debug("Has Sizzle Object:", !!Sizzle);
View
@@ -4,6 +4,9 @@
<title>Jasy Compat</title>
</head>
<body>
- <script src="main.js"></script>
+ <h1>Jasy Compat</h1>
+ <p>Take a look in the console.</p>
+ <script src="script/kernel.js"></script>
+ <script src="script/main.js"></script>
</body>
</html>

0 comments on commit 0b66c22

Please sign in to comment.