-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from agorapulse/chore/kordamp
moved to kordamp
- Loading branch information
Showing
45 changed files
with
947 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false | ||
|
||
[*.yml] | ||
# YAML should be space separated see https://en.wikipedia.org/wiki/YAML#Pitfalls_and_implementation_defects | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Gradle RC Watchdog | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 13 * *' | ||
|
||
jobs: | ||
check: | ||
name: Verify the Latest Gradle Version | ||
runs-on: ubuntu-latest | ||
env: | ||
GRADLE_OPTS: "-Xmx6g -Xms4g" | ||
CI: true | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- uses: eskatos/gradle-command-action@v1 | ||
with: | ||
arguments: check --stacktrace | ||
gradle-version: rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright 2019-2021 Agorapulse. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
name: Check | ||
|
||
on: [push, pull_request] | ||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
env: | ||
GRADLE_OPTS: "-Xmx6g -Xms4g" | ||
CI: true | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: eskatos/gradle-command-action@v1 | ||
with: | ||
arguments: check coveralls --stacktrace | ||
- name: Show Reports | ||
uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: reports | ||
path: build/reports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
env: | ||
GRADLE_OPTS: "-Xmx6g -Xms4g" | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Semantic Version | ||
id: version | ||
uses: ncipollo/semantic-version-action@v1 | ||
- uses: eskatos/gradle-command-action@v1 | ||
with: | ||
arguments: gitPublishPush bintrayUpload -PbintrayUsername=${{ secrets.BINTRAY_USER }} -PbintrayApiKey=${{ secrets.BINTRAY_KEY }} -Pversion=${{ steps.version.outputs.tag }} -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} --stacktrace | ||
ping: | ||
name: Notify Upstream Repositories | ||
runs-on: ubuntu-latest | ||
needs: [release] | ||
strategy: | ||
matrix: | ||
repository: | ||
- agorapulse/agorapulse-bom | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Semantic Version | ||
id: version | ||
uses: ncipollo/semantic-version-action@v1 | ||
- name: Dispatch to ${{ matrix.repository }} | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
token: ${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} | ||
repository: ${{ matrix.repository }} | ||
event-type: ap-new-version-released-event | ||
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-rethrow", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.rethrow.version", "github" : ${{ toJson(github) }} }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
Thumbs.db | ||
.DS_Store | ||
.gradle | ||
|
||
# Gradle | ||
build/ | ||
target/ | ||
out/ | ||
.idea | ||
.gradle/ | ||
|
||
# IDEs | ||
|
||
*.c9 | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.project | ||
.settings | ||
.classpath | ||
*.vscode | ||
.idea/ | ||
.asscache | ||
MANIFEST.MF | ||
out | ||
|
||
# PAW | ||
*.paw | ||
|
||
# Redis | ||
*.rdb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#Lazybones saved template parameters | ||
#Tue Apr 13 07:59:24 CEST 2021 | ||
name=Micronaut Rethrow | ||
id=micronaut-rethrow | ||
dev.name=Vladimir Orany | ||
dev.id=musketyr | ||
bintray.repo=libs | ||
bintray.org=agorapulse | ||
desc=Micronaut Rethrow Library | ||
pkg=com.agorapulse.micronaut.rethrow | ||
vendor=Agorapulse | ||
group=com.agorapulse | ||
org=agorapulse |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,11 @@ | ||
# Micronaut Rethrow | ||
|
||
Simple around advice which catches errors of given type and rethrows them | ||
as another type. | ||
[](https://github.com/agorapulse/micronaut-rethrow/actions) | ||
[](https://bintray.com/agorapulse/libs/micronaut-rethrow/_latestVersion) | ||
[](https://coveralls.io/github/agorapulse/micronaut-rethrow?branch=master) | ||
|
||
## Installation | ||
Micronaut Rethrow Library | ||
|
||
``` | ||
repositories { | ||
jcenter() | ||
} | ||
See [Full Documentation][DOCS] | ||
|
||
dependencies { | ||
compile 'com.agorapulse:micronaut-rethrow:0.1.0' | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Annotate a service method with the `@Rethrow` annotation to wrap the exceptions thrown inside the method | ||
into a different one. | ||
|
||
```java | ||
@Singleton | ||
public class MyService { | ||
|
||
@Rethrow( | ||
// rethrow exceptions as IllegalStateException | ||
as = IllegalStateException.class, | ||
// optional message | ||
message = "Something wrong happened", | ||
// optional filter | ||
only = IllegalArgumentException.class | ||
) | ||
void doSomeWork() { | ||
// throws IllegalArgumentException | ||
} | ||
|
||
// you can declare a function which does the conversion for you | ||
// other annotations's properties are ingored in that case | ||
@Rethrow(RethrowFuction.class) | ||
void doOtherWork() { | ||
// throws IllegalArgumentException | ||
} | ||
|
||
} | ||
|
||
public class RethrowFunction implements Function<Throwable, RuntimeException> { | ||
|
||
public RuntimeException apply(Throwable th) { | ||
return new IllegalStateException("Rethrown using function", th); | ||
} | ||
|
||
} | ||
``` | ||
|
||
If you are using Groovy code you can use `Closure` to declare the function: | ||
|
||
```groovy | ||
@Singleton | ||
class OtherService { | ||
@Rethrow({ new IllegalStateException(it)}) | ||
void doSomething() { | ||
// exceptional code | ||
} | ||
} | ||
``` | ||
[DOCS]: https://agorapulse.github.io/micronaut-rethrow |
Oops, something went wrong.