Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #222 from xdev-software/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
AB-xdev authored Jan 18, 2024
2 parents 7b96059 + 70ed252 commit 14d14ba
Show file tree
Hide file tree
Showing 20 changed files with 357 additions and 384 deletions.
141 changes: 141 additions & 0 deletions .config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Only check code -->
<property name="fileExtensions" value="java"/>
<property name="severity" value="error"/>

<property name="tabWidth" value="4"/>

<module name="SuppressionFilter">
<property name="file" value=".config/checkstyle/suppressions.xml"/>
</module>

<module name="FileLength"/>
<module name="LineLength">
<property name="max" value="120"/>
<property name="fileExtensions" value="java"/>
<!-- Ignore default + links in comments -->
<property name="ignorePattern" value="(^(package|import))|(^\s*(\/\/|\*) .*https?.*$)"/>
</module>
<module name="NewlineAtEndOfFile"/>

<module name="RegexpSingleline">
<!-- Ignore inside block comments (*) -->
<property name="format" value="[^\s\*][\s]{1,}$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing whitespaces"/>
</module>

<!-- Generated code -->
<module name="SuppressionSingleFilter">
<property name="checks" value="."/>
<property name="files" value="[\\/](src)?gen[\\/].*\.java$"/>
</module>
<module name="SuppressionSingleFilter">
<property name="checks" value="."/>
<property name="files" value="[\\/]src[\\/]gen(erated)?[\\/].*\.java$"/>
</module>
<!-- Test code -->
<module name="SuppressionSingleFilter">
<property name="checks" value="MagicNumberCheck"/>
<property name="files" value="[\\/]test[\\/].*\.java$"/>
</module>
<module name="SuppressWarningsFilter"/>

<module name="TreeWalker">
<!-- Checks - sorted alphabetically -->
<module name="ArrayTypeStyle"/>
<module name="AvoidStarImport"/>
<module name="ConstantName"/>
<module name="DefaultComesLast"/>
<module name="EmptyBlock"/>
<module name="EmptyCatchBlock"/>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization">
<property name="severity" value="info"/>
</module>
<module name="FinalClass"/>
<module name="FinalParameters"/>
<module name="GenericWhitespace"/>
<module name="HideUtilityClassConstructor"/>
<module name="IllegalImport"/>
<module name="InterfaceIsType"/>
<module name="JavadocStyle">
<property name="checkFirstSentence" value="false"/>
</module>
<module name="LeftCurly">
<!-- Default minus Lambda -->
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
<property name="option" value="nl"/>
</module>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MagicNumber">
<property name="ignoreAnnotation" value="true"/>
<property name="ignoreFieldDeclaration" value="true"/>
<property name="ignoreHashCodeMethod" value="true"/>
<!-- Defaults + other common constant values (e.g. time) -->
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 10, 12, 24, 31, 60, 100, 1000"/>
</module>
<module name="MemberName"/>
<module name="MethodLength"/>
<module name="MethodName"/>
<module name="MethodParamPad"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="MissingSwitchDefault"/>
<module name="ModifierOrder"/>
<module name="NeedBraces"/>
<module name="NoClone"/>
<module name="NoFinalizer"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OneStatementPerLine"/>
<module name="OneTopLevelClass"/>
<module name="OperatorWrap"/>
<module name="OuterTypeNumber"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="ParenPad"/>
<module name="RedundantImport"/>
<module name="RequireThis"/>
<module name="RightCurly">
<property name="option" value="alone"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="StaticVariableName"/>
<module name="StringLiteralEquality"/>
<module name="SuppressWarningsHolder"/>
<module name="TodoComment">
<property name="severity" value="info"/>
</module>
<module name="TypecastParenPad"/>
<module name="TypeName"/>
<module name="UnusedImports"/>
<module name="UpperEll"/>
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
<property name="protectedAllowed" value="true"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA,SEMI"/>
</module>
<module name="WhitespaceAround">
<property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
</module>

<!-- Filter -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="\s*CHECKSTYLE:OFF\s*[^\s]{1,}"/>
<property name="onCommentFormat" value="\s*CHECKSTYLE:ON"/>
</module>
</module>
</module>
6 changes: 6 additions & 0 deletions .config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
</suppressions>
33 changes: 30 additions & 3 deletions .github/workflows/checkBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ on:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.idea/**'
- 'assets/**'

env:
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
Expand All @@ -21,14 +27,14 @@ jobs:

strategy:
matrix:
java: [17]
java: [17, 21]
distribution: [temurin]

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
Expand Down Expand Up @@ -56,8 +62,29 @@ jobs:
fi
- name: Upload demo files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: demo-files-java-${{ matrix.java }}
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
if-no-files-found: error

code-style:
runs-on: ubuntu-latest

strategy:
matrix:
java: [17]
distribution: [temurin]

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Run Checkstyle
run: mvn -B checkstyle:check -P checkstyle -T2C
32 changes: 19 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down Expand Up @@ -101,12 +101,15 @@ jobs:
Add the following lines to your pom:
```XML
<dependency>
<groupId>com.xdev-software</groupId>
<groupId>software.xdev</groupId>
<artifactId>${{ env.PRIMARY_MAVEN_MODULE }}</artifactId>
<version>${{ steps.version.outputs.release }}</version>
</dependency>
```
### Additional notes
* [Spring-Boot] You may have to include ``software/xdev`` inside [``vaadin.whitelisted-packages``](https://vaadin.com/docs/latest/integrations/spring/configuration#configure-the-scanning-of-packages)
publish_central: # Publish the code to central
runs-on: ubuntu-latest
needs: [prepare_release]
Expand All @@ -120,7 +123,7 @@ jobs:
git pull
- name: Set up JDK Apache Maven Central
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
java-version: '17'
distribution: 'temurin'
Expand All @@ -133,8 +136,8 @@ jobs:
- name: Publish to Apache Maven Central
run: mvn -B deploy -Possrh
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}

Expand All @@ -152,7 +155,7 @@ jobs:
git pull
- name: Setup - Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -163,7 +166,7 @@ jobs:
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}

- name: Upload licenses - Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dependencies-licenses
path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/site
Expand Down Expand Up @@ -223,9 +226,12 @@ jobs:
git push origin
- name: pull-request
uses: repo-sync/pull-request@v2
with:
destination_branch: "develop"
pr_title: "Sync back"
pr_body: "An automated PR to sync changes back"

env:
GH_TOKEN: ${{ github.token }}
run: |
gh_pr_up() {
gh pr create "$@" || gh pr edit "$@"
}
gh_pr_up -B "develop" \
--title "Sync back" \
--body "An automated PR to sync changes back"
12 changes: 7 additions & 5 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.idea/**'
- 'assets/**'
- 'config/**'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'
- '.config/**'
- '.idea/**'
- 'assets/**'
- 'config/**'

env:
SONARCLOUD_ORG: ${{ github.event.organization.login }}
Expand All @@ -31,20 +33,20 @@ jobs:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

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

- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK OSSRH
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '17'
Expand All @@ -27,6 +27,6 @@ jobs:
run: mvn -B deploy -Possrh
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
17 changes: 9 additions & 8 deletions .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ jobs:
echo "abort=0" >> $GITHUB_OUTPUT
- name: pull-request
uses: repo-sync/pull-request@v2
if: steps.main.outputs.abort == 0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.UPDATE_BRANCH }}
destination_branch: ${{ steps.main.outputs.current_branch }}
pr_title: "Update from template"
pr_body: "An automated PR to sync changes from the template into this repo"

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh_pr_up() {
gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@")
}
gh_pr_up -B "${{ steps.main.outputs.current_branch }}" \
--title "Update from template" \
--body "An automated PR to sync changes from the template into this repo"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ vite.generated.ts
/*/frontend/generated/
/*/frontend/index.html
/*/src/main/dev-bundle/
/*/src/main/bundles/
*.lock

#custom
.flattened-pom.xml
Expand Down
Loading

0 comments on commit 14d14ba

Please sign in to comment.