Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 41 additions & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
name: Java CI

on: [pull_request]
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Compile all modules
run: ./gradlew testClasses

- name: Run tests for all modules
run: ./gradlew test

dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v1
- uses: joschi/setup-jdk@v1
with:
java-version: 'openjdk13'
architecture: 'x64'
- name: Build with Gradle
run: ./gradlew build
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
183 changes: 86 additions & 97 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,128 +1,117 @@
import org.apache.tools.ant.filters.ReplaceTokens

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.2.0.RELEASE"
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:4.0.0-M1"
}
}

rootProject.version = "0.0.1"
group = "com.spaceshift"

allprojects {

apply plugin: "java"
apply plugin: "groovy"
apply plugin: "org.springframework.boot"
apply plugin: "java"
apply plugin: "groovy"
apply plugin: "org.springframework.boot"

sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14
//sourceCompatibility = JavaVersion.VERSION_17
//targetCompatibility = JavaVersion.VERSION_17

repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url "https://dl.bintray.com/javasabr/maven" }
}
repositories {
mavenCentral()
mavenLocal()
}

ext {
annotationVersion = "17.0.0"
rlibVersion = "9.9.0"
lombokVersion = '1.18.4'
springbootVersion = '2.2.0.RELEASE'
springVersion = '5.1.6.RELEASE'
junitJupiterVersion = "5.5.2"
testcontainersVersion = "1.12.1"
groovyVersion = "3.0.4"
spockVersion = "2.0-M3-groovy-3.0"
projectReactorVersion = "3.3.0.RELEASE"
byteBuddyVersion = "1.10.2"
objenesisVersion = "3.1"
gsonVersion = "2.8.6"
}
dependencies {

dependencies {

implementation "com.spaceshift:rlib.network:$rlibVersion"
implementation "com.spaceshift:rlib.logger.slf4j:$rlibVersion"
implementation "org.springframework.boot:spring-boot-starter:$springbootVersion"
implementation "org.springframework.boot:spring-boot-starter-log4j2:$springbootVersion"
implementation "io.projectreactor:reactor-core:$projectReactorVersion"
implementation "com.google.code.gson:gson:$gsonVersion"

compileOnly "org.jetbrains:annotations:$annotationVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"

// FIXME to remove
testCompile "com.hivemq:hivemq-mqtt-client:1.1.2"
testCompile "io.moquette:moquette-broker:0.12.1"

testCompileOnly "org.jetbrains:annotations:$annotationVersion"
testImplementation "org.springframework:spring-test:$springVersion"
testImplementation "org.spockframework:spock-core:$spockVersion"
testImplementation "org.spockframework:spock-spring:$spockVersion"
testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion"
testImplementation "net.bytebuddy:byte-buddy-dep:$byteBuddyVersion"
testImplementation "org.objenesis:objenesis:$objenesisVersion"
}
implementation libs.rlib.network
implementation libs.rlib.logger.slf4j
implementation libs.springboot.starter.core
implementation libs.springboot.starter.log4j2
implementation libs.project.reactor.core
implementation libs.gson

sourceSets {
main {
java {
srcDirs 'src/main/groovy'
}
}
test {
java {
srcDirs 'src/test/groovy'
}
}
}

tasks.withType(Test) {
maxParallelForks = 2
forkEvery = 100
jvmArgs += "--enable-preview"
}

tasks.withType(JavaCompile) {
options.compilerArgs += "--enable-preview"
}

tasks.withType(GroovyCompile) {
options.forkOptions.jvmArgs += "--enable-preview"
compileOnly libs.jetbrains.annotations
compileOnly libs.jspecify
compileOnly libs.lombok
annotationProcessor libs.lombok

// FIXME to remove
testImplementation libs.hivemq.mqtt.client
// FIXME to remove
testImplementation libs.moquette.broker
testImplementation libs.spring.test
testImplementation libs.spock.core
testImplementation libs.spock.spring
testImplementation libs.groovy.all
testImplementation libs.byte.buddy.dep
testImplementation libs.objenesis
testCompileOnly libs.jetbrains.annotations
testCompileOnly libs.jspecify
}

test {
useJUnitPlatform()
failOnNoDiscoveredTests = false
}

sourceSets {
main {
java {
srcDirs 'src/main/groovy'
}
}

processResources {
filter(ReplaceTokens, tokens: [
])
test {
java {
srcDirs 'src/test/groovy'
}
}
}

tasks.withType(Test).configureEach {
maxParallelForks = 2
forkEvery = 100
jvmArgs += "--enable-preview"
}

tasks.withType(JavaCompile).configureEach {
options.compilerArgs += "--enable-preview"
}

tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs += "--enable-preview"
}

processResources {
filter(ReplaceTokens, tokens: [
])
}
}

task buildSingleArtifact(type: GradleBuild) {
group = 'build'
description = 'Build all modules -> Build result artifact'
tasks = ['build', 'bootJar']
group = 'build'
description = 'Build all modules -> Build result artifact'
tasks = ['build', 'bootJar']
}

task buildSingleArtifactWithoutTests(type: GradleBuild) {
group = 'build'
description = 'Build all modules without tests -> Build result artifact'
tasks = ['classes', 'bootJar']
group = 'build'
description = 'Build all modules without tests -> Build result artifact'
tasks = ['classes', 'bootJar']
}

wrapper {
gradleVersion = '6.6-milestone-1'
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '6.6-milestone-1'
distributionType = Wrapper.DistributionType.ALL
}

configurations.each {
it.exclude group: "org.slf4j", module: "slf4j-log4j12"
it.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
it.exclude group: "org.slf4j", module: "slf4j-log4j12"
it.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
}
59 changes: 59 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[versions]
# https://gitlab.com/JavaSaBr/maven-repo/-/packages
rlib = "10.0.alpha"
# https://mvnrepository.com/artifact/org.jetbrains/annotations
jetbrains-annotations = "26.0.2"
# https://mvnrepository.com/artifact/org.projectlombok/lombok
lombok = "1.18.38"
# https://mvnrepository.com/artifact/org.jspecify/jspecify
jspecify = "1.0.0"
# https://mvnrepository.com/artifact/org.testcontainers/testcontainers
testcontainers = "1.21.3"
# https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
junit-jupiter = "5.13.4"
# https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher
junit-platform-launcher = "1.13.4"
# https://mvnrepository.com/artifact/io.projectreactor/reactor-core
project-reactor = "3.7.8"
# https://mvnrepository.com/artifact/com.google.code.gson/gson
gson = "2.13.1"
# https://mvnrepository.com/artifact/org.spockframework/spock-core
spock = "2.4-M6-groovy-4.0"
# https://mvnrepository.com/artifact/org.apache.groovy/groovy-all
groovy = "4.0.28"
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
springboot = '3.5.4'
# https://mvnrepository.com/artifact/org.springframework/spring-core
spring = '6.2.9'
# https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy
byte-buddy = "1.17.6"
# https://mvnrepository.com/artifact/org.objenesis/objenesis
objenesis = "3.4"
# https://mvnrepository.com/artifact/com.hivemq/hivemq-mqtt-client
hivemq-mqtt-client = "1.3.7"
# https://mvnrepository.com/artifact/io.moquette/moquette-broker
moquette-broker = "0.17"


[libraries]
rlib-network = { module = "javasabr.rlib:rlib-network", version.ref = "rlib" }
rlib-logger-slf4j = { module = "javasabr.rlib:rlib-logger-slf4j", version.ref = "rlib" }
springboot-starter-core = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot" }
springboot-starter-log4j2 = { module = "org.springframework.boot:spring-boot-starter-log4j2", version.ref = "springboot" }
project-reactor-core = { module = "io.projectreactor:reactor-core", version.ref = "project-reactor" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }

jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" }
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }

spring-test = { module = "org.springframework:spring-test", version.ref = "spring" }
spock-core = { module = "org.spockframework:spock-core", version.ref = "spock" }
spock-spring = { module = "org.spockframework:spock-spring", version.ref = "spock" }
groovy-all = { module = "org.apache.groovy:groovy-all", version.ref = "groovy" }
byte-buddy-dep = { module = "net.bytebuddy:byte-buddy-dep", version.ref = "byte-buddy" }
objenesis = { module = "org.objenesis:objenesis", version.ref = "objenesis" }
hivemq-mqtt-client = { module = "com.hivemq:hivemq-mqtt-client", version.ref = "hivemq-mqtt-client" }
moquette-broker = { module = "io.moquette:moquette-broker", version.ref = "moquette-broker" }

[bundles]
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-milestone-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

rootProject.name = 'MQTT-Broker'
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@RequiredArgsConstructor
public class MqttConnectionConfig {

private final @NotNull QoS maxQos;
private final QoS maxQos;

private final int maximumPacketSize;
private final int minKeepAliveTime;
Expand Down
Loading
Loading