Skip to content

Commit 3e7833f

Browse files
authored
Merge pull request #6 from bee-produced/5-restructure-project
Restructure project
2 parents 5f71162 + 3345fc5 commit 3e7833f

File tree

164 files changed

+644
-674
lines changed

Some content is hidden

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

164 files changed

+644
-674
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Extend DGS:
2323

2424
Some changes are currently being made:
2525

26-
* `lib.data`
26+
* `bee.persistent`
2727
Easier data handling for GraphQL + JPA, [documentation](./lib.data/README.md)
28-
* `lib.result`
29-
Functional kotlin bindings, integration with DGS & more
30-
* `lib.events`
28+
* `bee.functional`
29+
Functional kotlin bindings, integration with DGS, `bee.persistent` & more
30+
* `bee.buzz`
3131
Simple event manager based on the mediator pattern, based on C#'s [MediatR library](https://github.com/jbogard/MediatR)
3232

lib.events/build.gradle.kts renamed to bee.buzz/build.gradle.kts

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
/*
2-
The Library Loader plugin currently has an IDEA bug that causes it to not recognize the "libs" variable.
3-
Until https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed the suppress annotation is required.
4-
*/
5-
@Suppress("DSL_SCOPE_VIOLATION")
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
63
plugins {
74
alias(libs.plugins.kotlin.jvm)
85
alias(libs.plugins.spring.boot).apply(false)
@@ -14,6 +11,11 @@ group = "com.beeproduced"
1411
version = libs.versions.bee.built.get()
1512
java.sourceCompatibility = JavaVersion.VERSION_17
1613
java.targetCompatibility = JavaVersion.VERSION_17
14+
tasks.withType<KotlinCompile>().configureEach {
15+
kotlinOptions {
16+
jvmTarget = "17"
17+
}
18+
}
1719

1820
repositories {
1921
mavenCentral()
@@ -45,7 +47,7 @@ java {
4547
}
4648

4749
dependencies {
48-
implementation("com.beeproduced:result")
50+
implementation("com.beeproduced:bee.functional")
4951
implementation(libs.kotlin.stdlib)
5052
implementation(libs.spring.boot.starter.web)
5153
testImplementation(libs.junit.api)
File renamed without changes.

lib.events/gradle/wrapper/gradle-wrapper.properties renamed to bee.buzz/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
rootProject.name = "events"
1+
rootProject.name = "bee.buzz"
22

33
dependencyResolutionManagement {
44
versionCatalogs {
55
create("libs") { from(files("../gradle/libs.versions.toml")) }
66
}
77
}
88

9-
includeBuild("../lib.result")
9+
includeBuild("../bee.functional")

lib.events/src/main/kotlin/com/beeproduced/lib/events/Notification.kt renamed to bee.buzz/src/main/kotlin/com/beeproduced/bee/buzz/Notification.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.beeproduced.lib.events
1+
package com.beeproduced.bee.buzz
22

33
/**
44
* Inspired by https://github.com/jbogard/MediatR/wiki.

lib.events/src/main/kotlin/com/beeproduced/lib/events/Request.kt renamed to bee.buzz/src/main/kotlin/com/beeproduced/bee/buzz/Request.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.beeproduced.lib.events
1+
package com.beeproduced.bee.buzz
22

3-
import com.beeproduced.result.errors.AppError
3+
import com.beeproduced.bee.functional.result.errors.AppError
44
import com.github.michaelbull.result.Result
55

66
/**

lib.events/src/main/kotlin/com/beeproduced/lib/events/manager/EventError.kt renamed to bee.buzz/src/main/kotlin/com/beeproduced/bee/buzz/manager/EventError.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.beeproduced.lib.events.manager
1+
package com.beeproduced.bee.buzz.manager
22

3-
import com.beeproduced.result.errors.InternalAppError
4-
import com.beeproduced.result.errors.ResultError
3+
import com.beeproduced.bee.functional.result.errors.InternalAppError
4+
import com.beeproduced.bee.functional.result.errors.ResultError
55

66
/**
77
*

lib.events/src/main/kotlin/com/beeproduced/lib/events/manager/EventManager.kt renamed to bee.buzz/src/main/kotlin/com/beeproduced/bee/buzz/manager/EventManager.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.beeproduced.lib.events.manager
1+
package com.beeproduced.bee.buzz.manager
22

33
/**
44
*

lib.events/src/main/kotlin/com/beeproduced/lib/events/manager/Mediator.kt renamed to bee.buzz/src/main/kotlin/com/beeproduced/bee/buzz/manager/Mediator.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package com.beeproduced.lib.events.manager
1+
package com.beeproduced.bee.buzz.manager
22

3-
import com.beeproduced.lib.events.Notification
4-
import com.beeproduced.lib.events.NotificationHandler
5-
import com.beeproduced.lib.events.Request
6-
import com.beeproduced.lib.events.RequestHandler
7-
import com.beeproduced.result.errors.AppError
3+
import com.beeproduced.bee.buzz.Notification
4+
import com.beeproduced.bee.buzz.NotificationHandler
5+
import com.beeproduced.bee.buzz.Request
6+
import com.beeproduced.bee.buzz.RequestHandler
7+
import com.beeproduced.bee.functional.result.errors.AppError
88
import com.github.michaelbull.result.Result
99

1010
/**

lib.events/src/main/kotlin/com/beeproduced/lib/events/manager/Scheduler.kt renamed to bee.buzz/src/main/kotlin/com/beeproduced/bee/buzz/manager/Scheduler.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.beeproduced.lib.events.manager
1+
package com.beeproduced.bee.buzz.manager
22

33
import java.util.concurrent.ScheduledFuture
44
import java.util.concurrent.TimeUnit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.beeproduced.bee.buzz.autoconfig
2+
3+
import com.beeproduced.bee.buzz.manager.EventManager
4+
import com.beeproduced.bee.buzz.manager.Mediator
5+
import com.beeproduced.bee.buzz.manager.Scheduler
6+
import com.beeproduced.bee.buzz.manager.SimpleEventManager
7+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass
8+
import org.springframework.context.annotation.Bean
9+
import org.springframework.context.annotation.Configuration
10+
11+
/**
12+
*
13+
*
14+
* @author Kacper Urbaniec
15+
* @version 2023-10-23
16+
*/
17+
@Configuration
18+
@ConditionalOnClass(value = [EventManager::class, Mediator::class, Scheduler::class])
19+
open class BeeBuzzAutoConfiguration {
20+
@Bean
21+
open fun beeBuzzEventManager() : EventManager {
22+
return SimpleEventManager()
23+
}
24+
}

lib.events/src/simple/kotlin/com/beeproduced/lib/events/manager/SimpleEventManager.kt renamed to bee.buzz/src/simple/kotlin/com/beeproduced/bee/buzz/manager/SimpleEventManager.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.beeproduced.lib.events.manager
1+
package com.beeproduced.bee.buzz.manager
22

3-
import com.beeproduced.lib.events.Notification
4-
import com.beeproduced.lib.events.NotificationHandler
5-
import com.beeproduced.lib.events.Request
6-
import com.beeproduced.lib.events.RequestHandler
7-
import com.beeproduced.lib.events.manager.exceptions.NotificationHandlerNotFound
8-
import com.beeproduced.lib.events.manager.exceptions.RequestHandlerNotFound
9-
import com.beeproduced.result.errors.AppError
3+
import com.beeproduced.bee.buzz.Notification
4+
import com.beeproduced.bee.buzz.NotificationHandler
5+
import com.beeproduced.bee.buzz.Request
6+
import com.beeproduced.bee.buzz.RequestHandler
7+
import com.beeproduced.bee.buzz.manager.exceptions.NotificationHandlerNotFound
8+
import com.beeproduced.bee.buzz.manager.exceptions.RequestHandlerNotFound
9+
import com.beeproduced.bee.functional.result.errors.AppError
1010
import com.github.michaelbull.result.Result
1111
import org.slf4j.LoggerFactory
1212
import org.springframework.util.LinkedMultiValueMap

lib.events/src/simple/kotlin/com/beeproduced/lib/events/manager/TestEventManager.kt renamed to bee.buzz/src/simple/kotlin/com/beeproduced/bee/buzz/manager/TestEventManager.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.beeproduced.lib.events.manager
1+
package com.beeproduced.bee.buzz.manager
22

3-
import com.beeproduced.lib.events.Request
4-
import com.beeproduced.result.errors.AppError
3+
import com.beeproduced.bee.buzz.Request
4+
import com.beeproduced.bee.functional.result.errors.AppError
55
import com.github.michaelbull.result.Result
66

77
open class TestEventManager : SimpleEventManager() {
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.beeproduced.lib.events.manager.exceptions
1+
package com.beeproduced.bee.buzz.manager.exceptions
22

33
/**
44
*
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.beeproduced.lib.events.manager.exceptions
1+
package com.beeproduced.bee.buzz.manager.exceptions
22

33
/**
44
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.beeproduced.bee.buzz.autoconfig.BeeBuzzAutoConfiguration

bee.fetched.test/build.gradle.kts

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask
22

3-
/*
4-
The Library Loader plugin currently has an IDEA bug that causes it to not recognize the "libs" variable.
5-
Until https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed the suppress annotation is required.
6-
*/
7-
@Suppress("DSL_SCOPE_VIOLATION")
83
plugins {
94
alias(libs.plugins.kotlin.jvm)
105
alias(libs.plugins.kotlin.spring)
116
alias(libs.plugins.kotlin.serialization)
127
alias(libs.plugins.spring.boot)
138
alias(libs.plugins.spring.dependencymanagement)
149
alias(libs.plugins.kotlin.jpa)
10+
// ksp plugin must be placed before kapt
11+
// https://github.com/google/ksp/issues/1445#issuecomment-1763422067
12+
alias(libs.plugins.ksp)
1513
alias(libs.plugins.kotlin.kapt)
1614
alias(libs.plugins.dgs.codegen)
1715
alias(libs.plugins.kotlin.allopen)
1816
alias(libs.plugins.kotlin.noarg)
1917
java
20-
alias(libs.plugins.ksp)
2118
id("bee.generative")
22-
2319
}
2420

2521
allprojects {
@@ -60,16 +56,16 @@ repositories {
6056

6157
dependencies {
6258
// in-house libraries
63-
implementation("com.beeproduced:events")
64-
implementation("com.beeproduced:events") {
65-
capabilities { requireCapability("com.beeproduced:events-simple") }
59+
implementation("com.beeproduced:bee.buzz")
60+
implementation("com.beeproduced:bee.buzz") {
61+
capabilities { requireCapability("com.beeproduced:bee.buzz-simple") }
6662
}
67-
implementation("com.beeproduced:result") {
68-
capabilities { requireCapability("com.beeproduced:result-dgs") }
63+
implementation("com.beeproduced:bee.functional") {
64+
capabilities { requireCapability("com.beeproduced:bee.functional-dgs") }
6965
}
70-
implementation("com.beeproduced:data")
71-
implementation("com.beeproduced:data") {
72-
capabilities { requireCapability("com.beeproduced:data-dgs") }
66+
implementation("com.beeproduced:bee.persistent")
67+
implementation("com.beeproduced:bee.persistent") {
68+
capabilities { requireCapability("com.beeproduced:bee.persistent-dgs") }
7369
}
7470
beeGenerative("com.beeproduced:bee.fetched")
7571
// external dependencies
@@ -156,4 +152,4 @@ tasks.getByName<Jar>("jar") {
156152

157153
tasks.bootRun {
158154
jvmArgs = listOf("-Dspring.output.ansi.enabled=ALWAYS")
159-
}
155+
}
818 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

bee.fetched.test/gradlew

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015-2021 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
# Busybox and similar reduced shells will NOT work, because this script
3333
# requires all of these POSIX shell features:
3434
# * functions;
35-
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36-
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37-
# * compound commands having a testable exit status, especially «case»;
38-
# * various built-in commands including «command», «set», and «ulimit».
35+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37+
# * compound commands having a testable exit status, especially «case»;
38+
# * various built-in commands including «command», «set», and «ulimit».
3939
#
4040
# Important for patching:
4141
#
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

bee.fetched.test/gradlew.bat

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal

0 commit comments

Comments
 (0)