How to Bootstrap Your Open-Source Projects
How to Bootstrap Your Open-Source Projects
For those eager to begin their first or next open-source project, take a look at this tool that can help you skip some of the more mundane open-source tasks.
Join the DZone community and get the full member experience.Join For Free
You have a great idea. You plan to implement it and release your software as an open-source project. You know that this is not an easy task. Besides coding, you will have to take care of a lot of other things, such as source code management, documentation, testing, code analysis, code coverage, continuous integration, licensing, versioning, providing scripts, publishing artifacts, and so on.
So, how do you start? Should you take care of all these things from the very beginning or postpone them and concentrate first on the coding part?
I asked myself this question every time I started a new project. When I’m excited by a new idea, I just can’t wait to start coding and I tend to see the other things as secondary. On the other hand, I know that the more I delay addressing these "secondary" concerns, the more difficult it is to deal with them later. And I am aware of how important they are for the success of an open-source project.
This means that one should first put in place a proper infrastructure for the project. But this takes a lot of time, which is frustrating when you’re impatient to start writing code. I wanted a tool that helps me set up a project in a couple of minutes. That’s how BootHub was born.
BootHub lets you generate a project skeleton based on a template of your choice. It’s not alone in this regard. Similar capability is provided by Maven archetypes, Gradle init tasks, Lazybones or Spring Initializr.
What sets BootHub apart from other tools is its ability to integrate with the GitHub ecosystem in order to set up a software delivery pipeline. To see how this works, let’s assume that you want to create a new Java project named "Chaos Maker," which should consist of three modules: API, core, and demo. After taking a look at the available templates, you decide that the Java/Groovy template best suits your needs:
As you can see in the image above, this template has a lot of features and it can be used for both single or multi-module projects written in Java, Groovy, or a combination of these two languages. BootHub asks for information about your project, so it can generate a custom skeleton:
After that, your project is available on GitHub. Its feature-rich Gradle file offers a series of useful tasks, and the provided Travis CI script executes some of these tasks in order to automate your work.
As shown below, the generated project also contains a README file:
After enabling Travis CI for your GitHub project, it will automatically generate Javadoc and AsciiDoc-based documentation and it will publish these documents to GitHub Pages, so the links in the README will become functional.
Note that Travis CI also generates and updates a list of all releases. At first, this list contains only links related to the latest snapshot, but new entries are added automatically each time you publish a new release. After a while, it will look like the list below:
Having links to the documentation of older versions is useful when some of your users don’t work with the latest version of your project. This way, they have access to information pertaining to the specific version they use.
BootHub can’t write the documentation for you, but the generated project comes with a documentation skeleton serving as a good starting point. It is structured in several sections that already contain information about system requirements, license, source code and Javadoc location, project artifacts and how users should configure them in Maven or Gradle, recommendations for developers on how to build the project and set it up in their IDEs, instructions on how to execute the Gradle task for uploading project artifacts to Bintray, and more.
When looking at the documentation skeleton in the image above, you may feel that your project already has documentation and you only need to add some more details. Of course, the truth is that you still have to put a lot of effort in writing a good documentation, but it really helps that you don’t start from zero.
Besides the web interface, BootHub also offers a command-line interface (CLI). Moreover, you have the possibility to install your own BootHub web server. This comes handy when you want to use your own template repository, which may include proprietary templates, or when you want to be able to generate project skeletons on your private GitHub organizations.
Now it’s time to use BootHub to turn your new idea into a successful project. But what if you don’t have an idea? What if you want to contribute to open source but don’t know where to start? Then, I have a suggestion for you: create and publish a BootHub template. Such a project is a great way to start contributing to open source, and making it available on the BootHub repository will give your template instant visibility.
If you choose to write a brand new template, the meta-template will help you to quick start your project. Templates are notoriously opinionated, so maybe you choose to take an existing one and adapt it to your taste. For example, you may create a variant of the Java/Groovy template, where you replace Clover with your favorite code-coverage library. Or, for a bigger challenge, you may implement the template’s capabilities using Maven instead of Gradle.
With BootHub, setting up a project becomes a simple operation. This changed the way I work. Today, I use BootHub even for small, throwaway programs, and most of the time these programs grow larger than I first imagined. No matter what project I'm working on, it feels good to know that I can concentrate on coding and I don’t have to spend my time taking care of the other things.
Opinions expressed by DZone contributors are their own.