24 Commits

Author SHA1 Message Date
hlaeja
5d24c50393 [RELEASE] - Bump version 2025-08-18 10:38:38 +00:00
hlaeja
c648326113 [RELEASE] - Release version: 0.10.0 2025-08-18 10:38:37 +00:00
f31cf2d860 add Nodes 2025-08-18 12:37:55 +02:00
01b23a1dfb cleanup .editorconfig 2025-08-18 12:37:55 +02:00
7f668f800e add Devices 2025-08-18 12:37:55 +02:00
cf6ad1ade0 add AccountMessage 2025-08-18 12:37:55 +02:00
hlaeja
ce7c4a7cd8 [RELEASE] - Bump version 2025-07-29 17:15:52 +00:00
hlaeja
833c86ad27 [RELEASE] - Release version: 0.9.0 2025-07-29 17:15:51 +00:00
f5ea7b05b4 update gradlew 2025-07-29 19:13:34 +02:00
0ac88bc52d update project 2025-07-29 19:13:34 +02:00
d7759d79d1 add GitHub action
- update release in README.md
- add action run checks
- add action release
- remove release.sh
2025-07-29 19:13:34 +02:00
e6abce764c [RELEASE] - bump version 2025-04-05 12:38:42 +02:00
44c468e546 [RELEASE] - release version: 0.8.0 2025-04-05 12:38:39 +02:00
bc4524b77f extract type response to types and add timestamp, and description to type 2025-04-01 19:23:50 +02:00
4cf3fb6985 [RELEASE] - bump version 2025-02-07 16:51:24 +01:00
1683686742 [RELEASE] - release version: 0.7.0 2025-02-07 16:51:19 +01:00
557254b406 change Account Request
- override toString dont print password
- make password nullable
2025-01-28 17:05:44 +01:00
59f0ab4c58 [RELEASE] - bump version 2025-01-02 07:09:38 +01:00
bff4d0812e [RELEASE] - release version: 0.6.0 2025-01-02 07:09:35 +01:00
d6f8af4917 add Authentication 2025-01-01 05:09:24 +01:00
c2dfd8f2cc add Account 2025-01-01 05:09:24 +01:00
e80feef083 change catalog version 2025-01-01 04:04:13 +01:00
51558d568e update README.md 2025-01-01 04:04:12 +01:00
8de493e4f6 [RELEASE] - bump version 2024-12-28 07:37:34 +01:00
18 changed files with 148 additions and 122 deletions

View File

@@ -15,18 +15,16 @@ max_line_length = 1024
[*.bat]
end_of_line = crlf
[*.sh]
indent_size = 2
tab_width = 2
# noinspection EditorConfigKeyCorrectness
[*.{kt,kts}]
ij_kotlin_packages_to_use_import_on_demand = unset
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_allow_trailing_comma = true
ktlint_standard_import-ordering = disabled
ktlint_standard_no-empty-first-line-in-class-body = disabled
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_packages_to_use_import_on_demand = unset
ktlint_standard_chain-method-continuation = disabled
ktlint_standard_class-signature = disabled
ktlint_standard_function-signature = disabled
ktlint_standard_parameter-list-wrapping = disabled
ktlint_standard_import-ordering = disabled
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_no-empty-first-line-in-class-body = disabled
ktlint_standard_parameter-list-wrapping = disabled
ktlint_standard_string-template-indent = disabled

12
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: Release
on:
workflow_dispatch:
jobs:
release:
uses: swordsteel/hlaeja-common-workflows/.github/workflows/release.yml@master
secrets:
CI_BOT_PAT: ${{ secrets.CI_BOT_PAT }}
with:
TYPE: artifact

12
.github/workflows/run-checks.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: Pull request validation
on:
pull_request:
paths-ignore:
- '.github/**'
jobs:
validate:
uses: swordsteel/hlaeja-common-workflows/.github/workflows/run-checks.yml@master
secrets:
CI_BOT_PAT: ${{ secrets.CI_BOT_PAT }}

View File

@@ -4,7 +4,7 @@ Classes for the common, messages to share, Classes for the systems, harmonized i
## Releasing library
Run `release.sh` script from `master` branch.
Run release pipeline from `master` branch.
## Publishing library
@@ -20,18 +20,22 @@ Run `release.sh` script from `master` branch.
./gradlew clean build publish
```
### Global gradle properties
### Global Settings
To authenticate with Gradle to access repositories that require authentication, you can set your user and token in the `gradle.properties` file.
This services rely on a set of global settings to configure development environments. These settings, managed through Gradle properties or environment variables.
Here's how you can do it:
*Note: For more information on global properties, please refer to our [global settings](https://github.com/swordsteel/hlaeja-development/blob/master/doc/global_settings.md) documentation.*
1. Open or create the `gradle.properties` file in your Gradle user home directory:
- On Unix-like systems (Linux, macOS), this directory is typically `~/.gradle/`.
- On Windows, this directory is typically `C:\Users\<YourUsername>\.gradle\`.
2. Add the following lines to the `gradle.properties` file:
```properties
repository.user=your_user
repository.token=your_token_value
```
or use environment variables `REPOSITORY_USER` and `REPOSITORY_TOKEN`
#### Gradle Properties
```properties
repository.user=your_user
repository.token=your_token_value
```
#### Environment Variables
```properties
REPOSITORY_USER=your_user
REPOSITORY_TOKEN=your_token_value
```

View File

@@ -1,6 +1,6 @@
plugins {
alias(hlaeja.plugins.kotlin.jvm)
alias(hlaeja.plugins.ltd.hlaeja.plugin.library)
alias(hlaeja.plugins.library)
}
dependencies {

View File

@@ -1,3 +1,3 @@
kotlin.code.style=official
version=0.5.0
catalog=0.7.0
version=0.11.0-SNAPSHOT
catalog=0.12.0

Binary file not shown.

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

9
gradlew vendored
View File

@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -115,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

4
gradlew.bat vendored
View File

@@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell

View File

@@ -1,89 +0,0 @@
#!/bin/sh
### This should be a pipeline, but for this example let use this ###
check_active_branch() {
if [ "$(git rev-parse --abbrev-ref HEAD)" != "$1" ]; then
echo "Error: The current branch is not $1."
exit 1
fi
}
check_uncommitted_changes() {
if [ -n "$(git status --porcelain)" ]; then
echo "Error: There are uncommitted changes in the repository."
exit 1
fi
}
prepare_environment() {
git fetch origin
}
check_last_commit() {
last_commit_message=$(git log -1 --pretty=format:%s)
if [ "$last_commit_message" = "[RELEASE] - bump version" ]; then
echo "Warning: Nothing to release!!!"
exit 1
fi
}
check_differences() {
if ! git diff --quiet origin/"$1" "$1"; then
echo "Error: The branches origin/$1 and $1 have differences."
exit 1
fi
}
un_snapshot_version() {
sed -i "s/\($1\s*=\s*[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/" gradle.properties
}
current_version() {
awk -F '=' '/version\s*=\s*[0-9.]*/ {gsub(/^ +| +$/,"",$2); print $2}' gradle.properties
}
stage_files() {
for file in "$@"; do
if git diff --exit-code --quiet -- "$file"; then
echo "No changes in $file"
else
git add "$file"
echo "Changes in $file staged for commit"
fi
done
}
commit_change() {
stage_files gradle.properties
git commit -m "[RELEASE] - $1"
git push --porcelain origin master
}
add_release_tag() {
gitTag="v$(current_version)"
git tag -a "$gitTag" -m "Release version $gitTag"
git push --porcelain origin "$gitTag"
}
snapshot_version() {
new_version="$(current_version | awk -F '.' '{print $1 "." $2+1 ".0"}')"
sed -i "s/\(version\s*=\s*\)[0-9.]*/\1$new_version-SNAPSHOT/" gradle.properties
}
# check and prepare for release
check_active_branch master
check_uncommitted_changes
prepare_environment
check_last_commit
check_differences master
# un-snapshot version for release
un_snapshot_version version
un_snapshot_version catalog
# release changes and prepare for next release
commit_change "release version: $(current_version)"
add_release_tag
snapshot_version
commit_change 'bump version'

View File

@@ -0,0 +1,24 @@
package ltd.hlaeja.library.accountRegistry
import java.time.ZonedDateTime
import java.util.UUID
object Account {
data class Request(
val username: String,
val password: CharSequence?,
val enabled: Boolean,
val roles: List<String>,
) {
override fun toString(): String = "Request(username=$username, password=******, enabled=$enabled, roles=$roles)"
}
data class Response(
val id: UUID,
val timestamp: ZonedDateTime,
val enabled: Boolean,
val username: String,
val roles: List<String>,
)
}

View File

@@ -0,0 +1,12 @@
package ltd.hlaeja.library.accountRegistry
object Authentication {
data class Request(
val username: String,
val password: CharSequence,
)
data class Response(
val token: String,
)
}

View File

@@ -0,0 +1,9 @@
package ltd.hlaeja.library.accountRegistry.event
import java.util.UUID
data class AccountMessage(
val userId: UUID,
val change: List<String>,
val timestamp: Long = System.currentTimeMillis(),
)

View File

@@ -0,0 +1,13 @@
package ltd.hlaeja.library.deviceRegistry
import java.time.ZonedDateTime
import java.util.UUID
object Devices {
data class Response(
val id: UUID,
val type: UUID,
val timestamp: ZonedDateTime,
)
}

View File

@@ -0,0 +1,15 @@
package ltd.hlaeja.library.deviceRegistry
import java.time.ZonedDateTime
import java.util.UUID
object Nodes {
data class Response(
val id: UUID,
val timestamp: ZonedDateTime,
val client: UUID,
val device: UUID,
val name: String,
)
}

View File

@@ -1,15 +1,19 @@
package ltd.hlaeja.library.deviceRegistry
import java.time.ZonedDateTime
import java.util.UUID
object Type {
data class Request(
val name: String,
val description: String,
)
data class Response(
val id: UUID,
val timestamp: ZonedDateTime,
val name: String,
val description: String,
)
}

View File

@@ -0,0 +1,13 @@
package ltd.hlaeja.library.deviceRegistry
import java.time.ZonedDateTime
import java.util.UUID
object Types {
data class Response(
val id: UUID,
val name: String,
val timestamp: ZonedDateTime,
)
}