Skip to content

Commit 54cccb8

Browse files
committed
chore: Refactor with tests and classes
1 parent 4e6b040 commit 54cccb8

File tree

84 files changed

+27833
-2243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+27833
-2243
lines changed

.circleci/config.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
java-version: [11, 17]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v5
1818

1919
- name: Set up JDK ${{ matrix.java-version }}
2020
uses: actions/setup-java@v3
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Upload test results
3333
if: always()
34-
uses: actions/upload-artifact@v3
34+
uses: actions/upload-artifact@v4
3535
with:
3636
name: test-results-java-${{ matrix.java-version }}
3737
path: target/surefire-reports/

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v5
15+
16+
- name: Setup Java
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
22+
- name: Cache Maven dependencies
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.m2
26+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: ${{ runner.os }}-m2
28+
29+
- name: Run tests
30+
run: mvn test
31+
32+
- name: Build project
33+
run: mvn clean package

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ target/
2222
*.war
2323
*.ear
2424
*.class
25+
26+
logs/file-compression.log

FileCompression.jar

-20.6 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# File Compression
22

33
[![Build and Test](https://github.com/ayonious/File-Compression/actions/workflows/build.yml/badge.svg)](https://github.com/ayonious/File-Compression/actions/workflows/build.yml)
4+
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/ayonious/File-Compression/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/ayonious/File-Compression/tree/master)
45
[![codecov](https://codecov.io/gh/ayonious/File-Compression/branch/master/graph/badge.svg)](https://codecov.io/gh/ayonious/File-Compression)
56
[![GitHub stars](https://img.shields.io/github/stars/ayonious/File-Compression?style=social)](https://github.com/ayonious/File-Compression/stargazers)
67

@@ -36,12 +37,6 @@ On macOS:
3637
brew install maven
3738
```
3839

39-
On Linux:
40-
```bash
41-
sudo apt-get install maven # For Debian/Ubuntu
42-
sudo dnf install maven # For Fedora
43-
```
44-
4540
Verify installation:
4641
```bash
4742
mvn -version
@@ -53,7 +48,7 @@ mvn -version
5348
### Directly Run the jar file
5449
I have included the already build jar file. You can run it simply if you dont want to build
5550
```bash
56-
java -jar FileCompression.jar
51+
java -jar file-compression-2.0-SNAPSHOT.jar
5752
```
5853

5954

@@ -67,20 +62,12 @@ mvn exec:java
6762
### Using JAR directly
6863
After building with Maven, you can run the JAR:
6964
```bash
70-
java -jar target/file-compression-1.0-SNAPSHOT-jar-with-dependencies.jar
65+
java -jar target/file-compression-2.0-SNAPSHOT-jar-with-dependencies.jar
7166
```
7267

73-
![Outlook](/git_resource/outlook.png?raw=true "File Compression GUI")
74-
75-
## Zip a file
76-
file>open>click zip>the zipped file will be created on the same folder
77-
78-
79-
## Unzip a file
80-
file>open>click unzip>the unzipped file will be created on the same folder
81-
68+
![Outlook](/git_resource/readmeScreenshot.png?raw=true "File Compression GUI")
8269

8370
## Testing environment:
8471

8572
I tested this project in:
86-
Linux Mint, OS X El Capitan (version 10.11.6), macOS Sonoma
73+
MacOS Tahoe (version 26.0.1)

git_resource/readmeScreenshot.png

391 KB
Loading

logs/file-compression.log

Lines changed: 8979 additions & 0 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,38 @@
66

77
<groupId>prog</groupId>
88
<artifactId>file-compression</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>2.0-SNAPSHOT</version>
1010

1111
<properties>
1212
<maven.compiler.source>21</maven.compiler.source>
1313
<maven.compiler.target>21</maven.compiler.target>
1414
<maven.compiler.release>21</maven.compiler.release>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<jacoco.version>0.8.12</jacoco.version>
1617
</properties>
1718

1819
<dependencies>
20+
<!-- JUnit for testing -->
1921
<dependency>
2022
<groupId>org.junit.jupiter</groupId>
2123
<artifactId>junit-jupiter</artifactId>
2224
<version>5.10.2</version>
2325
<scope>test</scope>
2426
</dependency>
27+
28+
<!-- SLF4J API for logging -->
29+
<dependency>
30+
<groupId>org.slf4j</groupId>
31+
<artifactId>slf4j-api</artifactId>
32+
<version>2.0.9</version>
33+
</dependency>
34+
35+
<!-- Logback Classic (includes logback-core) -->
36+
<dependency>
37+
<groupId>ch.qos.logback</groupId>
38+
<artifactId>logback-classic</artifactId>
39+
<version>1.4.14</version>
40+
</dependency>
2541
</dependencies>
2642

2743
<build>
@@ -67,19 +83,36 @@
6783
<groupId>org.apache.maven.plugins</groupId>
6884
<artifactId>maven-surefire-plugin</artifactId>
6985
<version>3.2.5</version>
86+
<configuration>
87+
<argLine>
88+
--add-opens java.base/java.lang=ALL-UNNAMED
89+
--add-opens java.base/java.util=ALL-UNNAMED
90+
--add-opens java.base/sun.util.resources.cldr.provider=ALL-UNNAMED
91+
${argLine}
92+
</argLine>
93+
</configuration>
7094
</plugin>
7195

7296
<!-- JaCoCo Plugin for code coverage -->
7397
<plugin>
7498
<groupId>org.jacoco</groupId>
7599
<artifactId>jacoco-maven-plugin</artifactId>
76-
<version>0.8.11</version>
100+
<version>${jacoco.version}</version>
101+
<configuration>
102+
<excludes>
103+
<exclude>**/module-info.class</exclude>
104+
<exclude>sun/util/resources/**</exclude>
105+
</excludes>
106+
</configuration>
77107
<executions>
78108
<execution>
79109
<id>prepare-agent</id>
80110
<goals>
81111
<goal>prepare-agent</goal>
82112
</goals>
113+
<configuration>
114+
<propertyName>argLine</propertyName>
115+
</configuration>
83116
</execution>
84117
<execution>
85118
<id>report</id>

renovate.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)