Skip to content

Commit

Permalink
Initial OpenCMW commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RalphSteinhagen authored and wirew0rm committed Feb 17, 2021
0 parents commit 4a236a4
Show file tree
Hide file tree
Showing 241 changed files with 41,276 additions and 0 deletions.
221 changes: 221 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# .clang-format for Qt Creator
#
# This is for clang-format >= 5.0.
#
# The configuration below follows the Qt Creator Coding Rules [1] as closely as
# possible. For documentation of the options, see [2].
#
# Use ../../tests/manual/clang-format-for-qtc/test.cpp for documenting problems
# or testing changes.
#
# In case you update this configuration please also update the qtcStyle() in src\plugins\clangformat\clangformatutils.cpp
#
# [1] https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html
# [2] https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortLambdasOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<Q.*'
Priority: 200
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 150
PenaltyBreakBeforeFirstCallParameter: 300
PenaltyBreakComment: 500
PenaltyBreakFirstLessLess: 400
PenaltyBreakString: 600
PenaltyExcessCharacter: 50
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
---
Language: Java
JavaImportGroups: ['java', 'javax', 'javafx', 'org', 'io', 'com', 'de.gsi']
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortLambdasOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<Q.*'
Priority: 200
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 150
PenaltyBreakBeforeFirstCallParameter: 300
PenaltyBreakComment: 500
PenaltyBreakFirstLessLess: 400
PenaltyBreakString: 600
PenaltyExcessCharacter: 50
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never

25 changes: 25 additions & 0 deletions .github/actions/get-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Get Version'
description: 'Get version/rev/changelist from github rev and git describe'
inputs:
versionPattern:
description: 'glob pattern to recognize valid version tags'
required: false
default: '[0-9]*.[0-9].[0-9]'
outputs:
revision:
description: 'The version as retrieved from the last tag + eventual updates since that tag'
value: ${{ steps.get-version.outputs.revision }}
sha1:
description: 'The shortened sha1 hash of the commit'
value: ${{ steps.get-version.outputs.sha1 }}
changelist:
description: 'empty for releases, otherwise -SNAPSHOT'
value: ${{ steps.get-version.outputs.changelist }}
runs:
using: "composite"
steps:
- id: get-version
shell: bash
run: ${{ github.action_path }}/version.sh
env:
VERSION_PATTERN: ${{ inputs.versionPattern }}
32 changes: 32 additions & 0 deletions .github/actions/get-version/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

echo "determining version for $GITHUB_REF"
if [[ "${GITHUB_REF#refs/tags/}" =~ ^${VERSION_PATTERN}$ ]]; then
export rev=${GITHUB_REF#refs/tags/}
export sha1=""
export changelist=""
else
export gh_ref=${GITHUB_REF#refs/*/}
export branch=${gh_ref/\//-}
if [[ $branch =~ ^[1-9]*-merge$ ]]; then
export branch=PR${branch%-merge}
fi
export lasttag=`git describe --tags --match=${VERSION_PATTERN} --abbrev=0`
export desc=`git describe --tags --match=${VERSION_PATTERN} --long`
if [[ -z "$lasttag" ]]; then
echo "[warning] Could not find last valid version number!"
export lasttag=0.0.1
export newcommits=-0
else
export tmp=${desc#"$lasttag"}
export newcommits=${tmp%-*}
fi
export rev=${lasttag}-${branch}${newcommits}
export sha1=-$(git rev-parse --short HEAD)
export changelist="-SNAPSHOT"
fi
echo "::set-output name=revision::$rev"
echo "::set-output name=sha1::$sha1"
echo "::set-output name=changelist::$changelist"
echo "Version will be:"
echo "${rev}${sha1}${changelist}"
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
109 changes: 109 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]
env:
JAVA_REFERENCE_VERSION: 11

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ] # TODO add: windows-latest, macOS-latest
java: [ 11, 16-ea ]
fail-fast: false
max-parallel: 6
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
environment: configure coverage
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- id: version
uses: ./.github/actions/get-version
with:
versionPattern: '${{ env.JAVA_REFERENCE_VERSION }}.[0-9]*.[0-9]*'
- uses: actions/cache@v1 # cache maven packages to speed up build
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v1.4.3
with:
java-version: ${{matrix.java}}
- name: Test with Maven
run: mvn -Dgpg.skip=true --no-transfer-progress --batch-mode -Drevision=${REVISION} -Dsha1=${SHA1} -Dchangelist=${CHANGELIST} package
env:
REVISION: ${{ steps.version.outputs.revision }}
SHA1: ${{ steps.version.outputs.sha1 }}
CHANGELIST: ${{ steps.version.outputs.changelist }}
- name: coverage report - send to Codecov
if: matrix.java == env.JAVA_REFERENCE_VERSION
uses: codecov/codecov-action@v1.2.1
- name: coverage report - send to Codacy
if: matrix.java == env.JAVA_REFERENCE_VERSION
uses: codacy/codacy-coverage-reporter-action@0.2.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}

publish:
name: Deploy to github packages and Sonatype OSSRH
needs: test
runs-on: ubuntu-latest
environment: deploy
steps:
- uses: actions/checkout@v2
- id: version
uses: ./.github/actions/get-version
with:
versionPattern: '${{ env.JAVA_REFERENCE_VERSION }}.[0-9]*.[0-9]*'
- name: Cache the Maven packages to speed up build
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK ${{ env.JAVA_REFERENCE_VERSION }}
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ env.JAVA_REFERENCE_VERSION }}
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: GPG_PASS
- name: Deploy to Github Packages
run: if [ -z "$CHANGELIST" ]; then mvn -DskipTests --no-transfer-progress --batch-mode -Drevision=${REVISION} -Dsha1=${SHA1} -Dchangelist=${CHANGELIST} -Drelease=github deploy; fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASS: ${{ secrets.GPG_PASSPHRASE }}
REVISION: ${{ steps.version.outputs.revision }}
SHA1: ${{ steps.version.outputs.sha1 }}
CHANGELIST: ${{ steps.version.outputs.changelist }}
- name: Set up JDK to publish to OSSRH
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ env.JAVA_REFERENCE_VERSION }}
server-id: ossrh
server-username: SONATYPE_USER
server-password: SONATYPE_PASS
# gpg-private-key: ${{ secrets.GPG_KEY }} # gpg key was already added in the first java-setup phase, will fail the cleanup if added again
gpg-passphrase: GPG_PASS
- name: Deploy to Maven Central
run: mvn -DskipTests --no-transfer-progress --batch-mode -Drevision=${REVISION} -Dsha1=${SHA1} -Dchangelist=${CHANGELIST} -Drelease=ossrh deploy
env:
GPG_PASS: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASS: ${{ secrets.SONATYPE_PASS }}
REVISION: ${{ steps.version.outputs.revision }}
SHA1: ${{ steps.version.outputs.sha1 }}
CHANGELIST: ${{ steps.version.outputs.changelist }}

...
Loading

1 comment on commit 4a236a4

@sormuras
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial commit and already published as Java modules to Maven Central! 😉

https://twitter.com/sormuras/status/1362289044588273665

Please sign in to comment.