-
Notifications
You must be signed in to change notification settings - Fork 443
Developer Guide
This should provide some information on how to contribute, develop and do stuff around sbt-native-packager
.
Most (all?) tests in sbt-native-packager use the scripted
library. This will fork a new instance of sbt and load a project, running commands specified in the test
file.
For most ubuntu systems, you can run a "as much as possible" run via:
$ sbt
> scripted universal/* debian/* rpm/*
The "native" tests are split by operating system, and then descriptive-ish name for what the test does. Current categories of tests:
-
osx
- Tests creating dmg files -scripted osx/*
-
windows
- Requires WiX 3.6 installation, testing creating MSIs -scripted windows/
-
cygwin
- Requires cygwin installed in the default location. Tests generated BASH files in cygwin (pathing fun) -
debian
- Requiresdpkg
, tests constructing debian files -scripted debian/*
-
rpm
- Requires rpmbuild, tests constructing rpm files -scripted rpm/*
-
universal
- Requireszip
,tar
andxz
. Tests generating OS-generic files, although it will use some OS native commands as these generally cause less issues than Java counterparts -scripted universal/*
You can run a specific test via the command scripted <test-group>/<test-type>
.
The documentation can be found under src/sphinx.
First you have to install the sphinx
and necessary dependencies
sudo apt-get install python-sphinx python-pip
pip install sphinx_rtd_theme
Now start up sbt with sbt
and start the automatic compilation with
~sphinx:generateHtml
Open the index.html
at target/sphinx/html
.
sbt ghpagesPushSite
How to release a version to Bintray and create a release tag.
Open sbt
> bintrayWhoami
None
> bintrayChangeCredentials
Now you have configured bintray.
Next you need the github changelog generator tool available in your shell. You also need a github token and access to the sbt-native-packager.
The recommended way is to release sbt-native-packager via travis. This requires two things
- Checkout the current
master
branch - Create a tag with the version number you want to release, e.g.
git tag -as "v2.0.0"
A release tag must always start with v
Push and let travis do the work.
- The
travis.yml
contains arelease
stage that is only executed when a tag starting withv
is pushed. - A encrypted tar file is decrypted which contasin
- A private pgp key for signing the jar
- A private ssh key which is added as a deploy key in sbt-native-packager to allow git push
- The
travis.yml
contains encrypted environment variables-
BINTRAY_USER
andBINTRAY_PASS
for bintray access -
CHANGELOG_GITHUB_TOKEN
for github access to create theCHANGELOG.md
-
- The git repository clone is
unshallowed
and the remote is changed tossh
to be able to use the deploy key - All required dependencies for the release process are installed. This includes
- github changelog generator
-
sphinx
and thesphinx_rtd_theme
which is required to publish the github pages
- sbt-dynver takes care of the correct versioning.
Note that only the unit tests are executed. This assumes that only pull requests that have passed all tests are merged into master.
Why not use the pgp key to encrypt files and instead use a tar file?
Future maintainers may want to keep the pgp key, but encrypt additional files. As I (@muuki88) have deleted the private pgp key, the only option to encrypt more files with pgp is to change the pgp key. IMHO the pgp key signing the package should not change constantly.
Why not use other sbt-plugins like release-early?
We already had some custom sbt-release steps in place. Besides, sbt-release wasn't the issue, but the travis setup ;)
Why not set the environment variables in the travis interface
They are pretty well hidden there. The travis.yml
should be as self contained as possible.
Why add another release script and not a sbt-release step?
The prechecks would fail without a proper git setup
- sbt-release issue with git
- auto deployment github pages (a lot of good inspiration!)
- unshallow a singlebranch git clone
- travis encrypt multiple files
- travis environment variables
Use https://github.com/skywinder/github-changelog-generator . This is part of the automated release process.