Skip to content

Commit 7bc0a04

Browse files
authored
restructure project (#64)
* refactor split app and server * change server to keva * rename keva -> core * update scripts * run reformat code * add publishing information * update contrib guide * update val usage * fix unit tests fail
1 parent 20c099b commit 7bc0a04

File tree

105 files changed

+615
-457
lines changed

Some content is hidden

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

105 files changed

+615
-457
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
github: [tuhuynh27, axblueblader]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
6-
ko_fi: tuhuynh27
6+
ko_fi: # Replace with a single Ko-Fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
88
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
99
liberapay: # Replace with a single Liberapay username

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
3535
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
36-
run: ./gradlew --parallel --info build sonarqube
36+
run: ./gradlew --parallel --info test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea/
22
build/
3+
dist/
34
.gradle/
45
.DS_Store
56
gradle.properties

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Developer guide
2+
3+
[See Developer Guide](https://keva.dev/guide/developer-guide.html)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ WORKDIR /root/src/keva
55

66
COPY gradle ./gradle
77
COPY build.gradle gradlew settings.gradle ./
8-
COPY ./server/build.gradle ./server/keva.properties ./server/
8+
COPY ./app/build.gradle ./app/keva.properties ./app/
99
RUN ./gradlew dependencies
1010

1111
COPY . .
12-
RUN ./gradlew :server:build -x test
12+
RUN ./gradlew :app:build -x test
1313

1414
FROM adoptopenjdk/openjdk11:jdk-11.0.6_10-alpine
1515

1616
RUN mkdir -p /root/binary/keva
1717
WORKDIR /root/binary/keva
1818

19-
COPY --from=builder /root/src/keva/server/build/libs/server-1.0-SNAPSHOT-all.jar /root/binary/keva/keva.jar
19+
COPY --from=builder /root/src/keva/app/build/libs/app-1.0-SNAPSHOT-all.jar /root/binary/keva/keva.jar
2020

2121
EXPOSE 6379
2222

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ cd keva
4343
Run:
4444

4545
```
46-
./gradlew :server:run
46+
./gradlew :app:run
4747
```
4848

4949
Build:
5050

5151
```
52-
./gradlew :build:server
52+
./gradlew :app:build
5353
```
5454

5555
## License

app/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
plugins {
2+
id 'application'
3+
id 'com.github.johnrengelman.shadow' version '6.0.0'
4+
id 'com.adarshr.test-logger' version '2.1.0'
5+
}
6+
7+
group 'dev.keva'
8+
version '1.0-SNAPSHOT'
9+
10+
repositories {
11+
mavenCentral()
12+
}
13+
14+
dependencies {
15+
implementation project(':core')
16+
implementation project(':config')
17+
18+
implementation 'ch.qos.logback:logback-classic:1.2.7'
19+
implementation 'ch.qos.logback:logback-core:1.2.7'
20+
21+
testImplementation 'redis.clients:jedis:3.7.0'
22+
}
23+
24+
shadowJar {
25+
minimize()
26+
}
27+
28+
application {
29+
mainClassName = 'dev.keva.app.Application'
30+
}
31+
32+
test {
33+
useJUnitPlatform()
34+
testLogging {
35+
outputs.upToDateWhen { true }
36+
showStandardStreams = true
37+
}
38+
maxParallelForks = Runtime.runtime.availableProcessors()
39+
}
File renamed without changes.

server/src/main/java/dev/keva/server/Application.java renamed to app/src/main/java/dev/keva/app/Application.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package dev.keva.server;
1+
package dev.keva.app;
22

33
import ch.qos.logback.classic.Level;
44
import ch.qos.logback.classic.LoggerContext;
55
import com.keva.config.ConfigLoader;
6-
import dev.keva.server.config.KevaConfig;
7-
import dev.keva.server.core.KevaServer;
6+
import dev.keva.core.config.KevaConfig;
7+
import dev.keva.core.server.KevaServer;
88
import lombok.extern.slf4j.Slf4j;
99
import lombok.val;
1010
import org.slf4j.LoggerFactory;

server/src/test/java/dev/keva/server/ApplicationTest.java renamed to app/src/test/java/dev/keva/app/ApplicationTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package dev.keva.server;
1+
package dev.keva.app;
22

3+
import dev.keva.app.Application;
34
import lombok.val;
45
import org.junit.jupiter.api.Test;
56
import redis.clients.jedis.Jedis;
@@ -17,7 +18,7 @@ void testMain() throws Exception {
1718
new Thread(() -> Application.main(ARGS)).start();
1819
TimeUnit.SECONDS.sleep(5);
1920

20-
Jedis jedis = new Jedis("localhost", 6379);
21+
val jedis = new Jedis("localhost", 6379);
2122
val pong = jedis.ping();
2223
assertEquals("PONG", pong);
2324
}

0 commit comments

Comments
 (0)