diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b765780 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# root editor configuration file +# https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# these configuration apply to all files in this project +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 +indent_style = tab + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dc9e3f5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# only edit text files +* text=auto +# don't use CRLF line endings +*.* text eol=lf + +# binaries +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2059673 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: 'github-actions' # See documentation for possible values + directory: '/' # Location of package manifests + schedule: + interval: 'daily' + open-pull-requests-limit: 10 + commit-message: + prefix: 'chore' + include: 'scope' diff --git a/.github/workflows/publish-core-image.yml b/.github/workflows/publish-core-image.yml new file mode 100644 index 0000000..72e069b --- /dev/null +++ b/.github/workflows/publish-core-image.yml @@ -0,0 +1,94 @@ +name: Publish Docker Image + +# Events that trigger this workflow +on: + workflow_run: + workflows: ["Release"] + types: [completed] + +jobs: + push-to-registry: + name: Build and push Docker image to GitHub Container Registry + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + defaults: + run: + working-directory: ./application + steps: + - name: Checkout 📥 + uses: actions/checkout@v2.3.4 + - name: Set up JDK 16 💿 + uses: actions/setup-java@v2.0.0 + with: + distribution: 'zulu' + java-version: '16' + java-package: jdk + - name: Set up Docker Buildx ⬆ + uses: docker/setup-buildx-action@v1.1.2 + + - name: Restore cache release upload URL ♻️ + uses: actions/cache@v2.1.5 + with: + path: ~/.build-env + key: 'github-release-action' + + - name: Import environment + run: cat ~/.build-env >> $GITHUB_ENV + + - name: Restore gradle cache ♻️ + uses: actions/cache@v2.1.5 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Cache Docker layers ♻️ + uses: actions/cache@v2.1.5 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build App 🛠️ + run: chmod +x gradlew && ./gradlew assembleDist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # You may need to manage write and read access of GitHub Actions + # for this repository in the container settings. + # + # You can also use a personal access token (PAT) with the appropriate scopes. + # + # Please see: + # https://github.com/marketplace/actions/docker-login#github-container-registry + - name: Login to GitHub Container Registry 🛂 + uses: docker/login-action@v1.8.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push docker image 🗜 + uses: docker/build-push-action@v2.4.0 + with: + context: . + pull: true + push: true + platforms: linux/amd64,linux/arm64 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + tags: "ghcr.io/${{ github.repository }}:latest" + + # Temporary fix for growing caches + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + # + # Please see: + # https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache + - name: Move cache ♻️ + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/publishImage.yml b/.github/workflows/publishImage.yml deleted file mode 100644 index d7021d1..0000000 --- a/.github/workflows/publishImage.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish Docker Image -on: - release: - types: [published] -jobs: - push_to_registry: - name: Push Docker image to GitHub Packages - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Set up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - - name: Build App - run: chmod +x gradlew && ./gradlew assembleDist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push to GitHub Packages - uses: docker/build-push-action@v1 - with: - path: ./ - username: ${{ github.ACTOR }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - always_pull: true - repository: ORGANIZATION_OR_USER_NAME/REPO_NAME/IMAGE_NAME - cache_froms: ORGANIZATION_OR_USER_NAME/REPO_NAME/IMAGE_NAME:latest - tags: latest - tag_with_ref: true - # tag_with_sha: true - add_git_labels: true - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dc0c4a6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +# Events that trigger this workflow +on: [workflow_dispatch] + +jobs: + conventional-release: + name: Conventional Commit Release + runs-on: ubuntu-latest + steps: + - name: Checkout 📥 + uses: actions/checkout@v2.3.4 + + - name: Cache release upload URL ♻️ + uses: actions/cache@v2.1.5 + with: + path: ~/.build-env + key: 'github-release-action' + + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + with: + github-token: ${{ secrets.github_token }} + release-count: '0' + - name: Create Release + uses: actions/create-release@v1 + if: ${{ steps.changelog.outputs.skipped == 'false' }} + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + with: + tag_name: ${{ steps.changelog.outputs.tag }} + release_name: ${{ steps.changelog.outputs.tag }} + body: ${{ steps.changelog.outputs.clean_changelog }} + + - name: Store upload url 🗜 + run: | + echo "upload_url=${UPLOAD_URL}" >> ~/.build-env + echo "tag=${RELEASE_TAG}" >> ~/.build-env + echo "skipped=${RELEASE_SKIPPED}" >> ~/.build-env + env: + UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }} + RELEASE_TAG: ${{ steps.changelog.outputs.tag }} + RELEASE_SKIPPED: ${{ steps.changelog.outputs.skipped }} diff --git a/.github/workflows/test-core-module.yml b/.github/workflows/test-core-module.yml new file mode 100644 index 0000000..880385d --- /dev/null +++ b/.github/workflows/test-core-module.yml @@ -0,0 +1,36 @@ +name: Test Core Module + +# Events that trigger this workflow +on: [push, pull_request] + +jobs: + test-core-module: + name: Test Core Module + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./application + steps: + - name: Checkout 📥 + uses: actions/checkout@v2.3.4 + - name: Set up JDK 16 💿 + uses: actions/setup-java@v2.0.0 + with: + distribution: 'zulu' + java-version: '16' + java-package: jdk + + - name: Restore gradle cache ♻️ + uses: actions/cache@v2.1.5 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Test App 🛃 + run: chmod +x gradlew && ./gradlew test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 1eaa523..e78ca78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,303 +1,3 @@ -# Created by .ignore support plugin (hsz.mobi) +# IDE configs .idea - -### Kotlin template -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### Gradle template -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - -### Java template -# Compiled class file - -# Log file - -# BlueJ files - -# Mobile Tools for Java (J2ME) - -# Package Files # - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml - -### Eclipse template -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# CDT- autotools -.autotools - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - -# Annotation Processing -.apt_generated/ -.apt_generated_test/ - -# Scala IDE specific (Scala & Java development for Eclipse) -.cache-main -.scala_dependencies -.worksheet - -# Uncomment this line if you wish to ignore the project description file. -# Typically, this file would be tracked if it contains build/dependency configurations: -#.project - -### macOS template -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Linux template -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### MATLAB template -# Windows default autosave extension -*.asv - -# OSX / *nix default autosave extension -*.m~ - -# Compiled MEX binaries (all platforms) -*.mex* - -# Packaged app and toolbox files -*.mlappinstall -*.mltbx - -# Generated helpsearch folders -helpsearch*/ - -# Simulink code generation folders -slprj/ -sccprj/ - -# Matlab code generation folders -codegen/ - -# Simulink autosave extension -*.autosave - -# Simulink cache files -*.slxc - -# Octave session info -octave-workspace - -### Windows template -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### Manual Additions ### -# Eclipse files -*.classpath -*.project - -# Project Files -modules/telestion-mavlink/src/main/messages/org/telestion/mavlink/ +.vscode diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9ccb96b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# Contributing Guidelines + +## Intended Release Cycle + +When you want to release a new application, go to the _Actions_ Tab in the GitHub UI and choose the `Release` Action. +Then click `Run workflow`. + +![image](https://user-images.githubusercontent.com/52416718/115860012-71cb7500-a420-11eb-9af1-d5faf0768f67.png) + +This triggers the Release Action which automatically creates a Conventional Commit Release on GitHub. +Afterwards the subsequent build actions are triggered via: +```yml +on: + workflow_run: + workflows: ["Release"] + types: [completed] +``` + +Additionally, if you want to upload release assets in these build workflows, you can use the cached build environment: +```yml + - name: Restore cache release upload URL ♻️ + uses: actions/cache@v2.1.5 + with: + path: ~/.build-env + key: 'github-release-action' + + - name: Import environment + run: cat ~/.build-env >> $GITHUB_ENV + + - name: Upload release asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.upload_url }} + asset_path: ./dist/artifact1.txt + asset_name: artifact1.txt + asset_content_type: text/plain +``` diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a2bece8..0000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM openjdk:14-alpine - -ENV WORK_DIR /usr/telestion - -EXPOSE 8080 - -COPY conf/config.json $WORK_DIR/config.json -COPY build/distributions/RocketSound-*.tar $WORK_DIR/ - -WORKDIR $WORK_DIR -ENTRYPOINT ["sh", "-c"] -CMD ["tar -xf *.tar && cd TelestionTemplate-* && mkdir conf && cp ../config.json conf/config.json && ./bin/TelestionTemplate"] diff --git a/README.md b/README.md index 72a8aa1..ed40239 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,20 @@ This is a template for Telestion applications. It helps you to set up the publishing of Telestion applications. -Dependencies to the [main repo](https://github.com/TelestionTeam/telestion) are included, too. +Dependencies to the [main repo](https://github.com/wuespace/telestion-core) are included, too. ## Necessary Changes -* [ ] `settings.gradle` - set `rootProject.name` -* [ ] `Dockerfile` - replace `TelestionTemplate` in the CMD block by the new project's name (they must match exactly!) -* [ ] `build.gradle` - replace `group` by your group name (it is recommended to follow [Maven Central `groupId` naming conventions](https://maven.apache.org/guides/mini/guide-naming-conventions.html), i.e., beginning with the company url in reverse) -* [ ] `.github/workflows/publishImage.yml` - update `ORGANIZATION_OR_USER_NAME/REPO_NAME/IMAGE_NAME`. Here, `IMAGE_NAME` doesn't have to match the project's name, but has to follow the rules for Docker Image names, cf. https://docs.docker.com/docker-hub/repos/#creating-repositories. -* [ ] `conf/config.json` - adapt to fit your needs -* [ ] `src/main/java` - add your source code -* [ ] Update readme +- [ ] `settings.gradle` - set `rootProject.name` +- [ ] `Dockerfile` - replace `TelestionTemplate` in the CMD block by the new project's name (they must match exactly!) +- [ ] `build.gradle` - replace `group` by your group name + (it is recommended to follow [Maven Central `groupId` naming conventions](https://maven.apache.org/guides/mini/guide-naming-conventions.html), + i.e., beginning with the company url in reverse) +- [ ] `conf/config.json` - adapt to fit your needs +- [ ] `src/main/java` - add your source code +- [ ] install the Telestion Client PSC (see [`client/README.md`](client/README.md) for further information) +- [ ] update the README ## Example Project -A working example is provided in the [RocketSound repository](https://github.com/TelestionTeam/telestion-rocketsound). +A working example is provided in the [RocketSound repository](https://github.com/wuespace/telestion-rocketsound). diff --git a/application/.gitignore b/application/.gitignore new file mode 100644 index 0000000..1eaa523 --- /dev/null +++ b/application/.gitignore @@ -0,0 +1,303 @@ +# Created by .ignore support plugin (hsz.mobi) +.idea + +### Kotlin template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Gradle template +.gradle +**/build/ +!src/**/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +### Java template +# Compiled class file + +# Log file + +# BlueJ files + +# Mobile Tools for Java (J2ME) + +# Package Files # + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml + +### Eclipse template +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### macOS template +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Linux template +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### MATLAB template +# Windows default autosave extension +*.asv + +# OSX / *nix default autosave extension +*.m~ + +# Compiled MEX binaries (all platforms) +*.mex* + +# Packaged app and toolbox files +*.mlappinstall +*.mltbx + +# Generated helpsearch folders +helpsearch*/ + +# Simulink code generation folders +slprj/ +sccprj/ + +# Matlab code generation folders +codegen/ + +# Simulink autosave extension +*.autosave + +# Simulink cache files +*.slxc + +# Octave session info +octave-workspace + +### Windows template +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### Manual Additions ### +# Eclipse files +*.classpath +*.project + +# Project Files +modules/telestion-mavlink/src/main/messages/org/telestion/mavlink/ diff --git a/application/Dockerfile b/application/Dockerfile new file mode 100644 index 0000000..df689d1 --- /dev/null +++ b/application/Dockerfile @@ -0,0 +1,12 @@ +FROM openjdk:14-alpine + +ENV WORK_DIR /usr/telestion + +EXPOSE 8080 + +COPY conf/config.json $WORK_DIR/config.json +COPY build/distributions/Telestion Project Template-*.tar $WORK_DIR/ + +WORKDIR $WORK_DIR +ENTRYPOINT ["sh", "-c"] +CMD ["tar -xf *.tar && cd Telestion\ Project\ Template-* && mkdir conf && cp ../config.json conf/config.json && ./bin/TelestionTemplate"] diff --git a/application/build.gradle b/application/build.gradle new file mode 100644 index 0000000..455e5c4 --- /dev/null +++ b/application/build.gradle @@ -0,0 +1,52 @@ +plugins { + id 'java' + id 'maven-publish' + id 'application' +} + +group 'de.wuespace.telestion.project.template' +version '1.0-SNAPSHOT' + +sourceCompatibility = gradle.sourceCompatibility +targetCompatibility = gradle.targetCompatibility + +application { + mainClassName = 'de.wuespace.telestion.Main' +} + + +repositories { + mavenCentral() + maven { + name = "GitHubPackages" + // TODO: Move to https://maven.pkg.github.com/wuespace/telestion-core/ + url = uri("https://maven.pkg.github.com/TelestionTeam/telestion/") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } +} + +dependencies { + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.12.1' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.1' + implementation "io.vertx:vertx-core:4.0.2" + implementation 'io.github.telestionteam:telestion-api:0.0.11' + implementation 'io.github.telestionteam:telestion-app:0.0.11' + implementation 'io.github.telestionteam:telestion-services:0.0.11' + implementation 'io.github.telestionteam:telestion-examples:0.0.11' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' +} + +test { + useJUnitPlatform() +} + +tasks.withType(Test) { + ignoreFailures = true + reports { + junitXml.enabled = true + } +} diff --git a/conf/config.json b/application/conf/config.json similarity index 100% rename from conf/config.json rename to application/conf/config.json diff --git a/gradle/wrapper/gradle-wrapper.jar b/application/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from gradle/wrapper/gradle-wrapper.jar rename to application/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/application/gradle/wrapper/gradle-wrapper.properties similarity index 93% rename from gradle/wrapper/gradle-wrapper.properties rename to application/gradle/wrapper/gradle-wrapper.properties index be52383..f371643 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/application/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/application/gradlew similarity index 100% rename from gradlew rename to application/gradlew diff --git a/gradlew.bat b/application/gradlew.bat similarity index 100% rename from gradlew.bat rename to application/gradlew.bat diff --git a/application/settings.gradle b/application/settings.gradle new file mode 100644 index 0000000..30bf16f --- /dev/null +++ b/application/settings.gradle @@ -0,0 +1,4 @@ +rootProject.name = 'Telestion Project Template' + +gradle.ext.sourceCompatibility = '16' +gradle.ext.targetCompatibility = '16' diff --git a/src/main/java/.gitkeep b/application/src/main/java/.gitkeep similarity index 100% rename from src/main/java/.gitkeep rename to application/src/main/java/.gitkeep diff --git a/build.gradle b/build.gradle deleted file mode 100644 index fba6d77..0000000 --- a/build.gradle +++ /dev/null @@ -1,74 +0,0 @@ -plugins { - id 'java' - id 'maven' - id 'application' -} - -group 'org.telestion.telestiontemplate' -version '1.0-SNAPSHOT' - -sourceCompatibility = gradle.sourceCompatibility -targetCompatibility = gradle.targetCompatibility - -application { - applicationDefaultJvmArgs = ['--enable-preview'] - mainClassName = 'org.telestion.application.Telestion' -} - - -repositories { - mavenCentral() - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/TelestionTeam/telestion/") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } - } -} - -dependencies { - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.12.1' - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.1' - implementation "io.vertx:vertx-core:4.0.2" - compile 'io.github.telestionteam:telestion-api:0.0.11' - compile 'io.github.telestionteam:telestion-app:0.0.11' - compile 'io.github.telestionteam:telestion-services:0.0.11' - compile 'io.github.telestionteam:telestion-examples:0.0.11' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' -} - -test { - useJUnitPlatform() -} - -tasks.withType(JavaExec) { - systemProperties System.properties - systemProperties "hazelcast.logging.type":"slf4j" - - //enable modules for hazelcast - jvmArgs += ["--add-modules", "java.se", - "--add-exports", "java.base/jdk.internal.ref=ALL-UNNAMED", - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.nio=ALL-UNNAMED", - "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", - "--add-opens", "java.management/sun.management=ALL-UNNAMED", - "--add-opens", "jdk.management/com.sun.management.internal=ALL-UNNAMED"] -} - -//enable preview features -tasks.withType(JavaCompile) { - options.compilerArgs += "--enable-preview" -} -tasks.withType(Test) { - jvmArgs += "--enable-preview" - ignoreFailures = true - reports { - junitXml.enabled = true - } -} -tasks.withType(JavaExec) { - jvmArgs += '--enable-preview' -} diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000..cba5d17 --- /dev/null +++ b/client/README.md @@ -0,0 +1,27 @@ +# Telestion Client PSC + +It looks like you have not initialized a PSC yet! + +## Initialization + +> **NOTE:** All commands below, unless otherwise specified, +> should get executed in the cloned project's root folder (the git root). + +To set up a PSC for this application, please install an up to date version of: + +- https://nodejs.org/en/ +- npm + +Then install our command line interface globally in your workspace: + +```shell +npm install --global @wuespace/telestion-client-cli +``` + +After the installation, initialize a new PSC: + +```shell +tc-cli init +``` + +Finished! diff --git a/definitions/.gitkeep b/definitions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 6400b1b..0000000 --- a/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = 'TelestionTemplate' - -gradle.ext.sourceCompatibility = '14' -gradle.ext.targetCompatibility = '14' - diff --git a/telestion-project b/telestion-project new file mode 100644 index 0000000..8fb44a2 --- /dev/null +++ b/telestion-project @@ -0,0 +1,3 @@ +This file is used to detect the folder structure within our automation tools. + +DO NOT EDIT, MOVE, RENAME, OR REMOVE this file, or our development automation tools might not work as expected