KS compiler is written in Scala language and thus uses SBT for building. It can be compiled in one of 2 ways:
-
generating Java
.class
files, to be run in JVM -
generating JavaScript
.js
file, to be run either inside a browser or in node.js environment
We use sbt-native-packager to build deployable formats.
-
sbt compilerJVM/universal:packageBin
-
Get result in
jvm/target/universal/kaitai-struct-compiler-*.zip
Building Debian package
-
Install prerequisites:
sudo -i apt-get install dpkg-deb dpkg-sig dpkg-genchanges lintian fakeroot
-
sbt compilerJVM/debian:packageBin
-
Get result in
jvm/target/kaitai-struct-compiler_*_all.deb
-
Install WIX
-
sbt compilerJVM/windows:packageBin
-
Get result in
jvm/target/windows/kaitai-struct-compiler.msi
-
Rename to add version to
kaitai-struct-compiler-$VERSION.msi
Building to JavaScript platform is done using a Scala.js project. Note that it uses a somewhat different set of dependencies, as they must actually be JavaScript libraries, not Java jars.
-
Run
sbt fastOptJS
-
Get result in
js/target/scala-2.11/kaitai-struct-compiler-fastopt.js
-
Use this JavaScript file on a website
-
Choose a new version number (WIX imposes harsh requirements for version to look like
x.x.x.x
) and update it inbuild.sbt
,version := …
, commit -
Prepare an entry in RELEASE_NOTES.md, commit
-
Create version tag:
-
git tag $VERSION
-
git push --tags
-
-
Update [main repository](https://github.com/kaitai-io/kaitai_struct)
-
Create new version at:
-
Upload:
-
https://bintray.com/kaitai-io/debian/kaitai-struct-compiler/$VERSION/upload
-
Debian distribution:
jessie
-
Debian component:
main
-
Debian architecture:
all
-
Attached file:
jvm/target/kaitai-struct-compiler_*_all.deb
-
-
https://bintray.com/kaitai-io/universal/kaitai-struct-compiler/$VERSION/upload
-
Target path:
$VERSION
-
Attached file:
jvm/target/universal/kaitai-struct-compiler-*.zip
-
-
https://bintray.com/kaitai-io/universal/kaitai-struct-compiler/$VERSION/upload
-
Target path:
$VERSION
-
Attached file:
jvm/target/windows/kaitai-struct-compiler-*.msi
-
-
-
Publish them all
-
Pump version, set version to
$VERSION
, without-SNAPSHOT
-
mvn deploy
-
Scroll to the very end of list, seek
iokaitai-…
repositories -
Select our staging repository
-
Press "Close" toolbar button
-
Confirm
-
Wait for checks to complete
-
-
Press "Release" toolbar button
-
Enter release message
-
Confirm
-
-
After some time, check https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22kaitai-struct-runtime%22 to have new version
-
Pump version in
setup.py
, seekversion=
-
python3 setup.py sdist upload
-
(use
python3 setup.py sdist upload -r pypitest
to publish to testing server)
-
-
Check that new version appears at https://pypi.python.org/pypi/kaitaistruct/$VERSION
-
git tag $VERSION
-
git push --tags
Don’t forget to update lists of languages:
-
/build.sbt - supportedLanguages
-
https://github.com/kaitai-io/kaitai_struct — project description
-
https://github.com/kaitai-io/kaitai_struct_compiler — project description
-
https://github.com/kaitai-io/kaitai_struct_compiler/blob/master/README.md —
-t
option documentation -
http://kaitai.io — everywhere
-
https://bintray.com/kaitai-io/debian/kaitai-struct-compiler/view — package description
-
https://twitter.com/kaitai_io — profile