Skip to content

Commit 79135a8

Browse files
Deploy
0 parents  commit 79135a8

File tree

20 files changed

+1879
-0
lines changed

20 files changed

+1879
-0
lines changed

.github/workflows/macos.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: MacOS-java
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
- name: Build with Maven and generate coverage report
20+
env:
21+
GITHUB_USERNAME: williamniemiec
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: mvn --settings src/java/settings.xml --file src/java/pom.xml jacoco:prepare-agent resources:testResources install jacoco:report
24+
- uses: codecov/codecov-action@v1
25+
with:
26+
file: ./**/target/site/jacoco/jacoco.xml
27+
name: codecov
28+

.github/workflows/ubuntu.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Ubuntu-java
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
- name: Build with Maven and generate coverage report
20+
env:
21+
GITHUB_USERNAME: williamniemiec
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: mvn --settings src/java/settings.xml --file src/java/pom.xml jacoco:prepare-agent resources:testResources install jacoco:report
24+
- uses: codecov/codecov-action@v1
25+
with:
26+
file: ./**/target/site/jacoco/jacoco.xml
27+
name: codecov
28+

.github/workflows/windows.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Windows-java
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
- name: Build with Maven and generate coverage report
20+
env:
21+
GITHUB_USERNAME: williamniemiec
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: mvn --settings src/java/settings.xml --file src/java/pom.xml jacoco:prepare-agent resources:testResources install jacoco:report
24+
- uses: codecov/codecov-action@v1
25+
with:
26+
file: ./**/target/site/jacoco/jacoco.xml
27+
name: codecov
28+

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Project
2+
.settings/
3+
*.iml
4+
.idea/
5+
6+
# Maven
7+
target/
8+
pom.xml.tag
9+
pom.xml.releaseBackup
10+
pom.xml.versionsBackup
11+
pom.xml.next
12+
release.properties
13+
dependency-reduced-pom.xml
14+
buildNumber.properties
15+
.mvn/timing.properties
16+
.mvn/wrapper/maven-wrapper.jar

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 William Niemiec
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
![](https://github.com/wniemiec-io-java/consolex/blob/master/docs/img/logo/logo.jpg)
2+
3+
<h1 align='center'>Consolex</h1>
4+
<p align='center'>Facilitator of reading and writing on the console.</p>
5+
<p align="center">
6+
<a href="https://github.com/wniemiec-io-java/consolex/actions/workflows/windows.yml"><img src="https://github.com/wniemiec-io-java/consolex/actions/workflows/windows.yml/badge.svg" alt=""></a>
7+
<a href="https://github.com/wniemiec-io-java/consolex/actions/workflows/macos.yml"><img src="https://github.com/wniemiec-io-java/consolex/actions/workflows/macos.yml/badge.svg" alt=""></a>
8+
<a href="https://github.com/wniemiec-io-java/consolex/actions/workflows/ubuntu.yml"><img src="https://github.com/wniemiec-io-java/consolex/actions/workflows/ubuntu.yml/badge.svg" alt=""></a>
9+
<a href="https://codecov.io/gh/wniemiec-io-java/consolex"><img src="https://codecov.io/gh/wniemiec-io-java/consolex/branch/master/graph/badge.svg?token=R2SFS4SP86" alt="Coverage status"></a>
10+
<a href="http://java.oracle.com"><img src="https://img.shields.io/badge/java-11+-D0008F.svg" alt="Java compatibility"></a>
11+
<a href="https://mvnrepository.com/artifact/io.github.wniemiec-io-java/consolex"><img src="https://img.shields.io/maven-central/v/io.github.wniemiec-io-java/consolex" alt="Maven Central release"></a>
12+
<a href="https://github.com/wniemiec-io-java/consolex/blob/master/LICENSE"><img src="https://img.shields.io/github/license/wniemiec-io-java/consolex" alt="License"></a>
13+
</p>
14+
<hr />
15+
16+
## ❇ Introduction
17+
Complete and easy-to-use console, featuring logging, read and write operations on the console, as well as text file display operations.
18+
19+
## ❓ How to use
20+
1. Add one of the options below to the pom.xml file:
21+
22+
#### Using Maven Central (recomended):
23+
```
24+
<dependency>
25+
<groupId>io.github.wniemiec-io-java</groupId>
26+
<artifactId>consolex</artifactId>
27+
<version>LATEST</version>
28+
</dependency>
29+
```
30+
31+
#### Using GitHub Packages:
32+
```
33+
<dependency>
34+
<groupId>wniemiec.io.java</groupId>
35+
<artifactId>consolex</artifactId>
36+
<version>LATEST</version>
37+
</dependency>
38+
```
39+
40+
2. Run
41+
```
42+
$ mvn install
43+
```
44+
45+
3. Use it
46+
```
47+
[...]
48+
49+
import wniemiec.io.java.Consolex;
50+
51+
[...]
52+
53+
String line = "hello world";
54+
Consolex.writeHeader(line);
55+
56+
Consolex.writeLine("Simple console message");
57+
58+
Consolex.writeError("Error message");
59+
Consolex.writeWarning("Warning message");
60+
Consolex.writeInfo("Info message");
61+
Consolex.writeDebug("Debug message");
62+
63+
System.out.println( Consolex.getHistory() );
64+
65+
[...]
66+
```
67+
68+
## 📖 Documentation
69+
| Property |Parameter type|Return type|Description|Default parameter value|
70+
|----------------|-------------------------------|-----|------------------------|--------|
71+
|readLine |`void`|`String`|Reads a line from console| - |
72+
|writeLine |`line: Object`|`void`|Write a line on the console, putting a line break at the end| - |
73+
|writeLines |`lines: (Object... | List<String>)`|`void`|Write lines on the console, putting a line break at the end of each line| - |
74+
|write |`content: Object`|`void`|Writes a content on the console without putting a line break at the end of each line| - |
75+
|writeFileLines | `file: Path`|`void`|Write lines from a text file to the console| - |
76+
|writeFileLinesWithEnumeration | `file: Path`|`void`|Write lines from a text file to the console. Besides, it shows the line number of each line on the left| - |
77+
|writeDiv | `symbol: String`|`void`|Writes a division line| `"-"` |
78+
|writeHeader | `title: Object, symbol: String`|`void`|Writes a title between two dividers| - , `"-"`|
79+
|writeError | `message: Object`|`void`|Displays an error message.| - |
80+
|writeWarning | `message: Object`|`void`|Displays a warning message.| - |
81+
|writeInfo | `message: Object`|`void`|Displays an info message. - |
82+
|writeDebug | `message: Object`|`void`|Displays a debug message.| - |
83+
|clearHistory | `void`|`void`|Clears the history of messages sent to the console| - |
84+
|dumpTo | `file: Path`|`void`|Exports the history of messages sent to the console to a file| - |
85+
|getHistory | `void`|`List<String>`|Gets messages sent to the console| - |
86+
|setMarginLeft | `margin: int`|`void`|Defines the distance between messages and the log level tag| - |
87+
|setLoggerLevel | `level: LogLevel`|`void`|Sets log level. The level defines what type of message will be displayed| - |
88+
|getLoggerLevel | `void`|`LogLevel`|Gets current log level. The level defines what type of message will be displayed| - |
89+
90+
91+
## 🚩 Changelog
92+
Details about each version are documented in the [releases section](https://github.com/williamniemiec/wniemiec-io-java/consolex/releases).
93+
94+
## 🤝 Contribute!
95+
See the documentation on how you can contribute to the project [here](https://github.com/wniemiec-io-java/consolex/blob/master/CONTRIBUTING.md).
96+
97+
## 📁 Files
98+
99+
### /
100+
| Name |Type|Description|
101+
|----------------|-------------------------------|-----------------------------|
102+
|dist |`Directory`|Released versions|
103+
|docs |`Directory`|Documentation files|
104+
|src |`Directory`| Source files|

dist/1.x/consolex-1.0.0.jar

19.2 KB
Binary file not shown.

docs/img/logo/logo.jpg

129 KB
Loading

0 commit comments

Comments
 (0)