Skip to content

Commit 7c26feb

Browse files
committed
Merge branch 'release/0.1.0'
2 parents b623b32 + 8490daa commit 7c26feb

File tree

9 files changed

+636
-0
lines changed

9 files changed

+636
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea/
2+
build/
3+
dist/
4+
docs/
5+
*.iml

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog][1] and this project adheres to
5+
[Semantic Versioning 2.0.0][2].
6+
7+
## [0.1.0][3] (2019-09-11)
8+
### Added
9+
* The class `Terminal` with static methods for writing to and reading from
10+
standard input and output.
11+
12+
13+
[1]: https://keepachangelog.com/en/1.0.0/
14+
[2]: https://semver.org/
15+
[3]: https://github.com/olivertwistor/java-tui/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# How to contribute to this project
2+
I'm happy that you are interested in contributing to this project. The open
3+
source community depends on people like you, and together we can make this
4+
project as good as it can possibly be. Thank you!
5+
6+
This document describes, first of all, code of conduct (a very important read),
7+
then some ideas of with what you may contribute and, last but not least,
8+
explanations on what you must do to start working on an issue and get your work
9+
merged into this project.
10+
11+
## Table of contents
12+
* [Code of conduct](#code-of-conduct)
13+
* [Contribution ideas](#contribution-ideas)
14+
* [How to make changes to the project][4]
15+
16+
## Code of conduct
17+
The open source community should be open and welcoming for all. I have a zero
18+
tolerance policy against discrimination of race, ethnicity, religious
19+
affiliation, sexual orientation, gender identity, age, disability etc.
20+
21+
I urge everyone to be respectful to each other and remember that behind that
22+
username is a human being. If someone makes a mistake or makes a "stupid"
23+
comment or question, please bear in mind that they may be a beginner, something
24+
everyone has once been.
25+
26+
Feel free to e-mail me at [oliver_twistor@hotmail.com][1] if you have any
27+
questions or complaints regarding this or anything else.
28+
29+
## Contribution ideas
30+
There are many ways in which you can contribute to this project. Some of them
31+
are listed in the following subsections.
32+
33+
### Start working on an open issue
34+
One very practical way in which you can contribute is to take a look at the
35+
[list of open and unassigned issues][3] to see if there is anything you want to
36+
help out with. For information on the necessary steps for that, please read the
37+
section *[How to make changes to the project][4]*.
38+
39+
### Report bugs, propose new features or changes in existing features
40+
All software has bugs and I would very much appreciate help with identifying and
41+
reporting bugs, so they can be fixed. This is a good way to contribute even if
42+
you aren't a programmer.
43+
44+
When you have used this application for a while, you may come up with some
45+
ideas of cool new features, or annoyances in existing features which you would
46+
want to have changed. I very much appreciate new ideas on how to improve this
47+
application.
48+
49+
#### How to create a new issue
50+
51+
1. Go to the [new issue][2] page.
52+
1. Write a short and succinct *title*.
53+
1. Provide more details in the *comment* field if the title isn't enough.
54+
1. If you don't have repository access, skip to the next step.
55+
1. Select an *assignee* that should handle the issue. If you're not
56+
selecting yourself, you should probably leave this blank.
57+
1. Choose *labels*, for example *bug* for bugs and *enhancement* for new or
58+
changed features.
59+
1. Leave *Project* blank since that is best determined at a later date,
60+
unless you're sure that the issue really should be part of the upcoming
61+
release.
62+
1. Leave also *Milestone* blank for the same reason as for *Project*.
63+
1. Press the button *Submit new issue*.
64+
65+
## How to make changes to the project
66+
I've found an excellent article on how to fork a repository, work on an issue
67+
and then do a pull request to have your changes merged into the target
68+
repository.
69+
70+
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/
71+
72+
73+
[1]: mailto:oliver_twistor@hotmail.com
74+
[2]: https://github.com/olivertwistor/java-tui/issues/new
75+
[3]: https://github.com/olivertwistor/java-tui/issues
76+
[4]: #how-to-make-changes-to-the-project

README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Java TUI
2+
This library provides the user with easier writing to and reading from the
3+
terminal.
4+
5+
## Table of contents
6+
* [Who is this for?](#who-is-this-for)
7+
* [Prerequisites][1]
8+
* [Installation instructions](#installation-instructions)
9+
* [Usage](#usage)
10+
* [Licensing](#licensing)
11+
* [How to contribute](#how-to-contribute)
12+
* [Versioning](#versioning)
13+
14+
## Who is this for?
15+
This library may be useful for those who work with text-based user interfaces.
16+
17+
## Prerequisites
18+
* [Java 7 or newer][2]
19+
20+
## Installation instructions
21+
This is a library, not a stand-alone application. Therefore it's intended to
22+
be included within other applications or libraries.
23+
24+
To make use of this library, please do the following:
25+
1. Make sure you meet the [prerequisites][1].
26+
1. Go to the [releases page][4] and find the specific version you want. The
27+
lastest release is [0.1.0][5].
28+
1. Download `java-tui-x.x.x.jar` and place it in your own application's
29+
classpath.
30+
1. If you want Javadoc, download `java-tui-x.x.x-javadoc.jar`.
31+
* Please refer to your particular IDE on how to attach that to the previous
32+
JAR file you downloaded.
33+
* If you're not using an IDE, you can unpack the JAR file and browse the
34+
Javadoc in a web browser.
35+
36+
### Build from source
37+
To build this library from source, please do the following:
38+
1. Make sure you meet the [prerequisites][1].
39+
1. Go to the [releases page][4] and find the specific version you want. The
40+
lastest release is [0.1.0][5].
41+
1. Download `java-tui-x.x.x-sources.jar` and unpack it.
42+
1. In that package, along with the source files you'll find the files
43+
`build.xml` and `build.properties`. With those, you can build the library
44+
(using [Apache ANT][6] or similar tools).
45+
46+
## Usage
47+
In this library, there is one usable class:
48+
`nu.olivertwistor.java.tui.Terminal`. With this class, the user can write to
49+
and read from standard input and output.
50+
51+
Here are some examples:
52+
53+
```java
54+
import nu.olivertwistor.java.tui.Terminal;
55+
56+
class App
57+
{
58+
public static void main(final String[] args) throws Exception
59+
{
60+
Terminal.writeLine("Welcome to this app!");
61+
Terminal.write("This is the beginning of one line. ");
62+
Terminal.writeLine("This is continuing on that line.");
63+
64+
final int age = Terminal.readInt("Please state your age: ");
65+
Terminal.write("Your age is ");
66+
Terminal.writeLine(age);
67+
}
68+
}
69+
```
70+
71+
This will produce the following output:
72+
73+
```
74+
Welcome to this app!
75+
This is the beginning of one line. This is continuing on that line.
76+
Please state your age: 36
77+
Your age is 36
78+
```
79+
80+
## Licensing
81+
This library is licensed under the MIT License. You'll find the full license
82+
terms in the file [LICENSE][3].
83+
84+
## How to contribute
85+
Thank you for wanting to contribute to this project. Open source is all about
86+
community. Go and read the document [CONTRIBUTING.md][12] for more information
87+
on with what you can contribute and how to go about it.
88+
89+
## Versioning
90+
This project uses [Semantic Versioning 2.0.0][13] for version numbering. To see
91+
what's changed between versions, please read [CHANGELOG.md][14]. That file also
92+
has links to the download section of each release.
93+
94+
95+
[1]: #prerequisites
96+
[2]: https://java.com/download/
97+
[3]: LICENSE
98+
[4]: https://github.com/olivertwistor/java-tui/releases
99+
[5]: https://github.com/olivertwistor/java-tui/releases/tag/v0.1.0
100+
[6]: https://ant.apache.org/
101+
[12]: CONTRIBUTING.md
102+
[13]: http://semver.org/
103+
[14]: CHANGELOG.md

build.properties

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Properties for the build script.
2+
3+
library.base.name = java-tui
4+
library.version = 0.1.0
5+
6+
src.dir = src/main/java
7+
tests.dir = src/tests/java
8+
build.dir = build
9+
docs.dir = docs
10+
dist.dir = dist/${library.version}
11+
12+
jar.partial.name = ${library.base.name}-${library.version}
13+
jar.classes.name = ${jar.partial.name}.jar
14+
jar.src.name = ${jar.partial.name}-sources.jar
15+
jar.tests.name = ${jar.partial.name}-tests.jar
16+
jar.docs.name = ${jar.partial.name}-javadoc.jar

build.xml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<project name="main.project" basedir="." default="dist.run.everything">
3+
4+
<!-- Get properties. -->
5+
<property file="build.properties"/>
6+
7+
<!-- Define fileset containing repo files that should be distributed
8+
together with the source code. -->
9+
<fileset id="fs.repodocs" dir=".">
10+
<include name="*.md"/>
11+
</fileset>
12+
13+
<!-- Define fileset containing license files that should be distributed
14+
together with both the source code and the class files. -->
15+
<fileset id="fs.licenses" dir=".">
16+
<include name="LICENSE"/>
17+
</fileset>
18+
19+
<!-- Define fileset containing the source code and resources (no tests). -->
20+
<fileset id="fs.src" dir=".">
21+
<include name="${src.dir}/**"/>
22+
</fileset>
23+
24+
<!-- Define fileset containing the test source code and resources. -->
25+
<fileset id="fs.tests" dir=".">
26+
<include name="${tests.dir}/**"/>
27+
</fileset>
28+
29+
<!-- Define fileset containing the build files with their properties. -->
30+
<fileset id="fs.buildfiles" dir=".">
31+
<include name="build.xml"/>
32+
<include name="build.properties"/>
33+
</fileset>
34+
35+
<!-- Delete and recreate the build folder. -->
36+
<target name="build.init">
37+
<delete dir="${build.dir}"/>
38+
<mkdir dir="${build.dir}"/>
39+
</target>
40+
41+
<!-- Delete and recreate the docs folder. -->
42+
<target name="docs.init">
43+
<delete dir="${docs.dir}"/>
44+
<mkdir dir="${docs.dir}"/>
45+
</target>
46+
47+
<!-- Create the dist folder (for the current version). -->
48+
<target name="dist.init">
49+
<mkdir dir="${dist.dir}"/>
50+
</target>
51+
52+
<!-- Compile the source code into class files. Also add licenses. -->
53+
<target name="build.run" depends="build.init">
54+
<javac srcdir="${src.dir}" destdir="${build.dir}"
55+
includeantruntime="false"/>
56+
<copy todir="${build.dir}">
57+
<fileset refid="fs.licenses"/>
58+
</copy>
59+
</target>
60+
61+
<!-- Generate Javadoc. -->
62+
<target name="docs.run" depends="docs.init">
63+
<javadoc sourcepath="${src.dir}" destdir="${docs.dir}"/>
64+
</target>
65+
66+
<!-- Build a JAR file containing only the class files. -->
67+
<target name="dist.run.classfiles" depends="dist.init, build.run">
68+
<jar destfile="${dist.dir}/${jar.classes.name}" basedir="${build.dir}"/>
69+
</target>
70+
71+
<!-- Build a JAR file containing only the source code and the build files.
72+
Also add repo docs and licenses. -->
73+
<target name="dist.run.sources" depends="dist.init">
74+
<jar destfile="${dist.dir}/${jar.src.name}">
75+
<fileset refid="fs.src"/>
76+
<fileset refid="fs.buildfiles"/>
77+
<fileset refid="fs.repodocs"/>
78+
<fileset refid="fs.licenses"/>
79+
</jar>
80+
</target>
81+
82+
<!-- Build a JAR file containing only the tests (source code). -->
83+
<target name="dist.run.tests" depends="dist.init">
84+
<jar destfile="${dist.dir}/${jar.tests.name}">
85+
<fileset refid="fs.tests"/>
86+
<fileset refid="fs.repodocs"/>
87+
<fileset refid="fs.licenses"/>
88+
</jar>
89+
</target>
90+
91+
<!-- Build a JAR file containing only the Javadoc files. -->
92+
<target name="dist.run.docs" depends="dist.init, docs.run">
93+
<jar destfile="${dist.dir}/${jar.docs.name}" basedir="${docs.dir}"/>
94+
</target>
95+
96+
<!-- Build all JAR files at the same time (class files, sources, tests and
97+
Javadoc). -->
98+
<target name="dist.run.everything" depends="dist.run.classfiles,
99+
dist.run.sources, dist.run.tests, dist.run.docs"/>
100+
101+
</project>

0 commit comments

Comments
 (0)