Skip to content

Commit 4e284e1

Browse files
committed
Initial commit
0 parents  commit 4e284e1

18 files changed

+1161
-0
lines changed

.github/FUNDING.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: darvil
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/gradle-ci-jar.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Jar
9+
10+
on:
11+
push:
12+
branches: [ "main", "dev" ]
13+
pull_request:
14+
branches: [ "main", "dev" ]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build:
21+
env:
22+
CI_GITHUB: 'x'
23+
CI_GITHUB_BRANCH: ${{ github.ref_name }}
24+
CI_GITHUB_USERNAME: ${{ github.actor }}
25+
CI_GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
26+
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Set up JDK 17
33+
uses: actions/setup-java@v3
34+
with:
35+
java-version: '17'
36+
distribution: 'temurin'
37+
38+
- name: Build with Gradle
39+
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
40+
with:
41+
arguments: jar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: JavadocJar
9+
10+
on:
11+
push:
12+
branches: [ "main", "dev" ]
13+
pull_request:
14+
branches: [ "main", "dev" ]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build:
21+
env:
22+
CI_GITHUB: 'x'
23+
CI_GITHUB_BRANCH: ${{ github.ref_name }}
24+
CI_GITHUB_USERNAME: ${{ github.actor }}
25+
CI_GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
26+
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Set up JDK 17
33+
uses: actions/setup-java@v3
34+
with:
35+
java-version: '17'
36+
distribution: 'temurin'
37+
38+
- name: Build with Gradle
39+
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
40+
with:
41+
arguments: javadocJar

.github/workflows/gradle-ci-tests.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Tests
9+
10+
on:
11+
push:
12+
branches: [ "main", "dev" ]
13+
pull_request:
14+
branches: [ "main", "dev" ]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build:
21+
22+
env:
23+
CI_GITHUB: 'x'
24+
CI_GITHUB_BRANCH: ${{ github.ref_name }}
25+
CI_GITHUB_USERNAME: ${{ github.actor }}
26+
CI_GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
27+
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v3
32+
33+
- name: Set up JDK 17
34+
uses: actions/setup-java@v3
35+
with:
36+
java-version: '17'
37+
distribution: 'temurin'
38+
39+
- name: Build with Gradle
40+
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
41+
with:
42+
arguments: test

.github/workflows/gradle-publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Package
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [ created ]
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
publish:
14+
env:
15+
CI_GITHUB: 'x'
16+
CI_GITHUB_BRANCH: ${{ github.ref_name }}
17+
ORG_GRADLE_PROJECT_GithubUsername: ${{ github.actor }}
18+
ORG_GRADLE_PROJECT_GithubPassword: ${{ secrets.GITHUB_TOKEN }}
19+
ORG_GRADLE_PROJECT_RepsyUsername: darvil
20+
ORG_GRADLE_PROJECT_RepsyPassword: ${{ secrets.REPSY_PASSWORD }}
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Set up JDK 17
28+
uses: actions/setup-java@v3
29+
with:
30+
java-version: '17'
31+
distribution: 'temurin'
32+
33+
- name: Validate Gradle wrapper
34+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
35+
36+
- name: publish
37+
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
38+
with:
39+
arguments: publish

.github/workflows/publish-docs.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Deploy Javadoc
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy JavaDoc
17+
uses: MathieuSoysal/[email protected]
18+
with:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
javadoc-branch: javadoc
21+
java-version: 17
22+
project: gradle

.gitignore

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea
9+
*.iws
10+
*.iml
11+
*.ipr
12+
out/
13+
!**/src/main/**/out/
14+
!**/src/test/**/out/
15+
16+
### Eclipse ###
17+
.apt_generated
18+
.classpath
19+
.factorypath
20+
.project
21+
.settings
22+
.springBeans
23+
.sts4-cache
24+
bin/
25+
!**/src/main/**/bin/
26+
!**/src/test/**/bin/
27+
28+
### NetBeans ###
29+
/nbproject/private/
30+
/nbbuild/
31+
/dist/
32+
/nbdist/
33+
/.nb-gradle/
34+
35+
### VS Code ###
36+
.vscode/
37+
38+
### Mac OS ###
39+
.DS_Store

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Terminal Text Formatter
2+
3+
Text formatting utilities to easily format text for the terminal in Java.
4+
5+
## Installation
6+
7+
The package is currently available on Repsy and GitHub Packages.
8+
9+
1. Add the following to your `repositories` block:
10+
```kotlin
11+
maven("https://repsy.io/mvn/darvil/java")
12+
```
13+
14+
2. And add the following to your `dependencies` block:
15+
```kotlin
16+
implementation("com.darvil:terminal-text-formatter:+")
17+
```
18+
> [!NOTE]
19+
> The `+` symbol is a wildcard that will automatically use the latest version of the package.
20+
> You can also specify a specific version (e.g. `0.0.1`).

build.gradle.kts

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
plugins {
2+
java
3+
`maven-publish`
4+
}
5+
6+
group = "com.darvil"
7+
version = "0.0.1"
8+
description = "Text formatting utilities to easily format text for the terminal in Java"
9+
10+
repositories {
11+
mavenCentral()
12+
}
13+
14+
dependencies {
15+
implementation("com.darvil:utils:+")
16+
17+
implementation("org.jetbrains:annotations:24.0.0")
18+
testImplementation(platform("org.junit:junit-bom:5.9.1"))
19+
testImplementation("org.junit.jupiter:junit-jupiter")
20+
}
21+
22+
java {
23+
withJavadocJar()
24+
withSourcesJar()
25+
26+
sourceCompatibility = JavaVersion.VERSION_17
27+
}
28+
29+
repositories {
30+
mavenCentral()
31+
maven("https://repsy.io/mvn/darvil/java")
32+
}
33+
34+
publishing {
35+
repositories {
36+
maven {
37+
name = "Github"
38+
url = uri("https://maven.pkg.github.com/darvil82/java-terminal-text-formatter")
39+
credentials(PasswordCredentials::class)
40+
}
41+
42+
maven {
43+
name = "Repsy"
44+
url = uri("https://repsy.io/mvn/darvil/java")
45+
credentials(PasswordCredentials::class)
46+
}
47+
}
48+
49+
publications {
50+
create<MavenPublication>("mavenJava") {
51+
from(components["java"])
52+
}
53+
}
54+
}
55+
56+
tasks.withType<JavaCompile>().configureEach {
57+
options.encoding = "UTF-8"
58+
}
59+
60+
tasks.withType<Javadoc>().configureEach {
61+
options.encoding = "UTF-8"
62+
}
63+
64+
tasks.test {
65+
useJUnitPlatform()
66+
}

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sun Nov 26 18:40:55 CET 2023
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)