Use SBT 0.13.1 to compile. See project/build.properties.
See:
- SwaggerIndexAction
- http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter
To update Swagger UI, copy dist directory from https://github.com/wordnik/swagger-ui to src/main/resources/public/xitrum as swagger-ui. Then in its index.html, replace:
...
window.swaggerUi = new SwaggerUi({
url: "http://petstore.swagger.wordnik.com/api/api-docs",
...
with:
...
window.swaggerUi = new SwaggerUi({
url: getUrl(),
...
getUrl:
var getUrl = function() {
if (!location.search) return '/xitrum/swagger.json';
var parts = location.search.substring(1).split('&');
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
if (part.indexOf('url=') == 0) {
var url = part.substring('url='.length);
return url;
}
}
return '/xitrum/swagger.json';
};
This file is for determining content types for static files.
See:
- https://github.com/klacke/yaws/blob/master/priv/mime.types
- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
- http://download.oracle.com/javaee/5/api/javax/activation/MimetypesFileTypeMap.html
I recommend Tcpdump / Wireshark, or even better Tcpflow: http://groups.google.com/group/sockjs/msg/12f28eccf1851d54
Demo: http://ngocdaothanh.github.io/xitrum/api/index.html#xitrum.Action
Graphviz is required, see build.sbt.end.
Demo: http://ngocdaothanh.github.io/xitrum/guide/deps.html
Generate target/dependencies-compile.dot:
sbt dependency-dot
Convert dependencies-compile.dot to deps.png:
dot -Tpng dependencies-compile.dot > deps.png
See: https://github.com/jrudolph/sbt-dependency-graph.
While developing, you may need do local publish. Run
sbt publish-local.
Alternatively you can run sbt then from SBT command prompt run
+ publish-local.
To delete the local publish:
$ find ~/.ivy2 -name *xitrum* -exec rm -rf {} \;
Before releasing a new Xitrum version, run sbt xitrum-package on project
xitrum-new and xitrum-demos, then see directory target/xitrum/lib to see
if there's any wrong with the versions of .jar files.
See: https://github.com/sbt/sbt.github.com/blob/gen-master/src/jekyll/using_sonatype.md
Create ~/.sbt/0.13/sonatype.sbt (for SBT 0.12: ~/.sbt/sonatype.sbt) file:
credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"<your username>",
"<your password>")
Then:
- Copy content of
- dev/build.sbt.end to the end of build.sbt dev/plugins.sbt.end to the end of project/plugins.sbt
- Run
sbt publish-signed. Alternatively you can runsbtthen from SBT command prompt run+ publish-signed. - Login at https://oss.sonatype.org/ and from "Staging Repositories" select the newly published item, click "Close" then "Release".
After each new version release, please update these projects to use that new Xitrum version:
Also update gh-pages branch of Xitrum and Xitrum guide.
When a new SBT generation is released, also update xitrum-sbt-plugin.